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

jus-config

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jus-config

Configuration handler, accepts multiple file formats, and overriding over multiple directories and filenames. Main usage: require('jus-config')(configNames, dirNames, callback).

latest
npmnpm
Version
0.0.2
Version published
Maintainers
0
Created
Source

jus-config

Jus-Config is a Node.JS module that will help you manager your configuration files, supporting multiple formats, and ability to load and merge multiple files over multiple directories.

Quick example

Suppose you want to make your app's port configurable. You'll have these two configuration files:

// "config/default.json"
// This is the default options
{ "host": "localhost"
, "port": 3000 }

// "config/prod.json"
// This is, for example, your unversionned env-specific configuration
{ "port": 80 }

Then you can load your configuration files this way:

var conf = require('jus-config')
  , express = require('express')
  , app = express.createServer()

// Load configuration from "config/default.json" and/or "config/prod.json"
conf.load(['default', 'prod'], function(err, config) {
  // config = { "host": "localhost", "port": 80 }
  app.listen(config.port, config.host)
})

Download and install

From npm

npm install jus-config

or add "jus-config" as a dependency in your package.json and call npm install.

From git

git clone the repository git@github.com:naholyr/node-jus-config.git in node_modules/jus-config. You're ready to go.

Documentation

Loading configuration

  • load - load configuration

Configure parsers

Debug mode

  • debug - enables/disables debug

FAQs

Package last updated on 24 May 2011

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