New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

settings-and-secrets

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

settings-and-secrets

A NodeJS module to help manage configuration settings.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

##settings and secrets

A NodeJS module to help manage configuration settings.

##Getting started

var settings = require('settings-and-secrets')();

var myStr = settings.prop1;

By default the module will look for config.json and secrets.json in the root folder of the project. Environment variables will override config file values. When first adding secrets.json remember to add it to the .gitigrnore file so it doesn't get added to the repository. All settings value will be available as properties of settings.

##Installation

npm install --save settings-and-secrets

##Configuration To add custom settings (which will override any settings of the same name in config.json or secrets.json) pass in a custom settings object as the first argument to the constructor.

var settings = require('settings-and-secrets')({
		rootDir: __dirname
	});

To change to json files to be used pass in an array of new files (with full paths) as the second argument to the constructor.

var settings = require('settings-and-secrets')(null,['./settings/connectionStrings.json','./settings/urls.json']);

Note that the new files array will replace the existing config file list not merge with it so if you still want to use the default config and secrets files you wil have to add those too.

To ignore environment variables and always use config files values set ignoreEnvVars to true.

var settings = require('settings-and-secrets')(null,null,true);

Keywords

FAQs

Package last updated on 11 Jul 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