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

confrodo

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confrodo

Configuration loader

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by160%
Maintainers
1
Weekly downloads
 
Created
Source

Basic Usage

You may pass in an object, a filename, the string "ARGV", or the string "ENV".

Options passed in later will override attributes with the same name from previous options.

Arguments may be passed in any order.

var confrodo = require("confrodo")
  , config
  , filename = "myconfig.json"
  , defaults = { "foo":"bar", "meow":"mix" };

config = confrodo(defaults, filename, "ARGV", "ENV");

Files may either be a valid json file or a javascript file that returns a json object in modules.exports.

Objects are json objects (not arrays).

"ARGV" will load any command line options (see optimist.)

"ENV" will load environment variables.

Confrodo also has an env property you can use to choose a file:


var confrodo = require("confrodo")
  , filename = __dirname + "/" + confrodo.env + ".json"
  , config = confrodo(filename);

confrodo.env will be "local", unless the NODE_ENV environment variable is set, or env is passed as a command line argument.

See LICENSE for copyright info.

Keywords

FAQs

Package last updated on 27 Feb 2012

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