Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

r-config

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

r-config

[r-config](https://github.com/rysenko/r-config) is a configuration loader for node.js projects.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

r-config is a configuration loader for node.js projects.

Installation

$ npm install r-config

Usage

var config = require('r-config');

Module will load JSON configurations from config folder in your project.

Configurations

It will load configurations in the following order.

  • config/config.json
  • config/config.<environment>.json

Environment defaults to development if not specified. Default sections specified in config.json will be overriden by sections specified it your environment-specific config.

config.json:

{
  "aws":{
    "key":"key1",
    "secret":"secret1"
  },
  "analytics":{
    "key":"value"
  }
}

config.development.json:

{
  "aws":{
    "key":"key2",
    "secret":"secret2"
  }
}

code.js

var config = require('r-config');
console.log(config);

This will be your merged config:

{
  "aws":{
    "key":"key2",
    "secret":"secret2"
  },
  "analytics":{
    "key":"value"
  }
}

FAQs

Package last updated on 17 Jun 2015

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