Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
reads config.json from process.cwd()
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

Description

Synchronously reads config.json or config//.json from process.cwd() or APP_ROOT environment variable, replacing occurrences of {{APP_ROOT}} in the JSON accordingly.

Latest Version

1.1.2

Installation

npm install configwd

or in package.json

{
  ...
  "dependencies": {
    "configwd": "1.1.x"
  }
}

Usage

var config = require('configwd');

For a folder setup like this:

APP_ROOT
  config
    config.json
    development
      barf.json
    production
      hurl.json

If config.json looks like:

{
  "environment": "development",
  "something": "else"
}

the resulting config will be:

{
  "environment": "development",
  "something": "else",
  "app_root": "/path/to/app",
  "barf" {
    /* whatever is in config/development/barf.json */
  }
}

This way of handling environments/namespaces is more restrictive than I'd like. Trying to think of a better way, but needed this for now.

Build status

build status

Something went wrong with that request. Please try again.