Socket
Book a DemoInstallSign in
Socket

conf-stack

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conf-stack

Stacked configuration files

0.0.7
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Configuration Stacks

This module provides a configuration factory

Sample usage

Install through npm

npm install conf-stack

By default conf-stack expects for you to have at least created a directory named conf at the working directory process.cwd(), within that directory conf-stacks expects a file base.yaml, this file will always be loaded into the returned config.

===

base.yaml

Basic sample, configuration that does not contain sensitive data

  • conf
    • base.yaml
  • index.js (sample code)
var getconf = require('conf-stack');
var config  = getconf();

console.log(config);

Run node index.js

===

env.yaml

Adding a non commited env.yaml for sensitive data (the env.yaml will be merged over base.yaml)

Within config dir

  • conf
    • base.yaml
    • env.yaml
  • index.js (sample code)

Or sibling of main process

  • conf
    • base.yaml
  • index.js (sample code)
  • env.yaml

Or at working directory node some/location/index.js

  • some
    • location
      • conf
        • base.yaml
      • index.js
  • env.yaml

===

Stacked

Stacked sample (the config object will have dev merged into base, and any env merged over the result)

  • conf
    • base.yaml
    • dev.yaml
  • index.js (sample code)
var getconf = require('conf-stack');
var config  = getconf();

console.log(config);

Run node index.js --confstack=dev

===

Factory:

require('conf-stack')([baseDir],[argName]);

===

Command Line

As a command line utility (also base, c,o,n,f,i,g,s, env):

Usages

  • Calling from a different language or process
  • Calling just to analyse a conf directory
  • Calling to create an output properties file using the prop format
# If you are in a directory with a child conf/base.yaml you can just call conf-stack
conf-stack
conf-stack --confstackrun prop
conf-stack --confstackrun json
conf-stack --confstackrun json --confstack somefile
conf-stack --confstackrun json --confstackdir some/relative/dir

Keywords

yaml

FAQs

Package last updated on 31 May 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.