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

configuror

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

configuror

A nodejs environment config loader supporting global/local style configuration and env style (dev/test/staging/prod)

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Table of Contents

  • 1. Configuror

Configuror

Config file loader based on 2 different configuration styles:

  • Global/Local
  • Environment (dev/test/staging/prod/etc…)

Supporting multiple file formats:

  • .js
  • .json
  • .yml

Sane defaults included…

Quick start

Given the following directory structure in your project root:

config/
  db.js
  api.js

var config = require('configuror')();

config will contain values from files in config/ merged.

Global/Local style configuration

by adding files with .local. preceding the extension allows overriding config options with machine specific values.

config/
  db.js
  api.js
  db.local.js

Environment style configuration

by adding files with .env. preceding the extension allows overriding config options with environment specific values.

config/
  db.js
  api.js
  api.test.js

NODE_ENV=test node app.js

With NODEENV set to test the api.test.js will override values in api.js

Details

Both global/local and environment style configurations can be mixed.

There are no predefined environments such as dev/test/staging/production so you can use any name desired for the environments.

Any of the above mentioned file formats can be used. db.local.yml will override db.js.

File formats

  • JS

    module.exports = {
      host: "example.com"
    }
    
  • JSON

    {
      "user": "jim"
    }
    
  • YAML

    ipaddress: 127.0.0.1
    

Keywords

config

FAQs

Package last updated on 21 Jan 2016

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