简体   繁体   中英

Config location for global / command line Node.js tool

I am creating a command line tool for Node.js and would like to give my users the ability to create configuration for it, so that they don't have to specify a lot of arguments at the command line. I am not familiar with the preferred methodology here. Is there a preferred way in Node.js-land to place config files for globally installed modules? There is no need to install the module locally anywhere, just globally, as it's a command line app.

You can place configuration files for global cli commands in the user's home directory. For example, the npm command used a config file present in ~/.npmrc by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM