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

best-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

best-config

Each app can has different server configurations, the goal of this module is manage them.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

best-config

Each app can has different server configurations, the goal of this module is manage them

Installation

npm install best-config --save

Example

Basic usage
const config = require('best-config')({
  file: 'config1'
});

console.log(config.foo); //=> bar

//Custom path "config" folder
const config = require('best-config')({
  file: 'config1',
  path: './custom/your-folder'
});

//Add configuration to global
require('best-config')({
  file: 'config1',
  addToGlobalWithName: '_MY_CONFIG_'
});

console.log(_MY_CONFIG_.foo); //=> bar

//Append another config file
const config = require('best-config')({
  file: 'config1.json',
  append: {
      key: 'other',
      file: 'commons.json'
  }
});

console.log(config.other.foo); //=> bar

API

  • fromEnv
  • fromHostname

Please see full documentation

Changelog

You can view the changelog here

License

best-config is open-sourced software licensed under the MIT license

Authors

Fabio Ricali

Keywords

FAQs

Package last updated on 04 Sep 2017

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