New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

config4u

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config4u

Environment, command line or JSON file with comments and single quotes

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

config4u

Environment, command line or JSON file with comments and single quotes

Wanted multiple tiered config like config https://github.com/lorenwest/node-config will use NODE_ENV and ALCE parsing like getconfig with the added ability to define config.json directory or filename via command line --config or environment variable NODE_CONFIG_DIR

Install :hammer:

npm install config4u

Usage :bulb:

{
    postgres: {
        "url": '...', // database connection url
    }
}
config = new require('config4u')({ default: "values"})
dburl  = config.postgres.url
node myapp.js --config dir_or_filename // /somepath for /somepath.config.json or dev_config.json for /current_dir/dev_config.json

Assignment order

  • Passed in defaults
  • config.json file (in current application directory if not defined by --config)
  • config.json file (as defined by --config)
  • config.json file (optionally if defined by NODE_CONFIG_DIR)
  • NODE_ENV environment value as JSON string, ex: NODE_ENV = "{postgres: {url: '...'}}"

Contributions :muscle:

:smile: Feedback, problem reports, enhancement requests are welcome.

:up: Example code are better.

:cool: Pull requests are best.

License

MIT

FAQs

Package last updated on 20 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts