Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jr-config

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jr-config

jr config

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

config-lite

A super simple & flexible & intuitive config module, support yaml & toml.

Install

$ npm i config-lite --save

Migration

In v1:

const config = require('config-lite');

In v2, you should specify config_basedir directory for bubbling find config file.

const config = require('config-lite')(__dirname);

Usage

const config = require('config-lite')(__dirname);

or:

const config = require('config-lite')({
  filename: 'test',
  config_basedir: __dirname,
  config_dir: 'config'
});

Options

  • filename: config file name, default: default, support: ['.js', '.json', '.node', '.yaml', '.yml', '.toml'].
  • config_basedir: directory for begining bubbling find config directory.
  • config_dir: config directory name, default: config.
  • config: default config object that overwrite config file.

Priority

environment option > custom option > default option

For example:

$ NODE_ENV=test NODE_CONFIG='{"port":3000}' node app.js --port=3001

loading order:

--port=3001 > NODE_CONFIG='{"port":3000}' > opt.config > test config file > default config file

Environment Variables

  • NODE_ENV -> filename
  • CONFIG_BASEDIR || NODE_CONFIG_BASEDIR -> config_dirname
  • CONFIG_DIR || NODE_CONFIG_DIR -> config_dir
  • CONFIG || NODE_CONFIG -> config

Test

$ npm test

License

MIT

Keywords

FAQs

Package last updated on 22 May 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc