Socket
Socket
Sign inDemoInstall

config-property-stamp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-property-stamp

A stamp that uses config to read configuration into a stamp property.


Version published
Maintainers
1
Created
Source

Build Status Coverage Status semantic-release

Config Property Stamp

A stamp (a composeable factory function) for use with stamp-it that creates an immutable deep property called config storing information from config with its' cascading configuration capabilities or an override with an arbitary configuration file you provide.

By itself you aren't gaining much, used in combination with other stamps you gain the composeable power to add the consistent config interface of the config module in an expected way.

For more information on using config

You can find detailed instructions on using config on the node-config wiki pages;

Usage

  • You need a configuration file, either an arbitrary file or in your Env config folder per config.

  • For loading up an arbitrary single config file:

// for a config file in the following path  {thepathWherethisCodeExecutes}/test/config.json
// with the following config
// {"item1": "test"}

const path = require('path');
// Factory Function.
const ConfigPropertyStamp = require('config-property-stamp');
const configPropertyStamp = ConfigPropertyStamp.create(path.join(__dirname, 'test', 'default.json'));
// configPropertyStamp is {item1: test}
  • For loading up config from default config module location:
// for a config file in the following path in your module config/default.json
// with the following config
// {"item1": "test2"}

const path = require('path');
const ConfigPropertyStamp = require('config-property-stamp');
// Looks for config in /config and cascades it all together.
const configPropertyStamp = ConfigPropertyStamp.create();
// configPropertyStamp is {item1: test2}

Keywords

FAQs

Package last updated on 27 Oct 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc