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

configwd

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

configwd

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
npmnpm
Version
1.1.2
Version published
Weekly downloads
12
500%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

config

FAQs

Package last updated on 01 May 2013

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