Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

environment-override

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

environment-override

Takes a JSON object and checks the environment variables for overrides to its values. Great for HAPIjs manifests and other configuration.

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Environment Override

view on npm npm module downloads per month Dependency status

Takes a object and checks the environment variables for overrides to its values. Great for manifests and other configuration.

How to use

The code is currently synchronous as its expected to only be run once as part of the startup of the app.

In code :

var override = require('environment-override');
var json = require('./some.json');
override(json, 'PREFIX_');

Or you can run it from the command line to see the variables you need to set :

node ./node_modules/environment-override/bin/show test.json

Use the following to see other options :

node ./node_modules/environment-override/bin/show --help

To override, simply set the environment variables you want to override, you can remove by setting the entry to be equal OVERRIDE_REMOVE_DATA.

To override whole structures use stringified JSON objects in variables. ie:

exports PREFIX_VARIABLE='{"key1": "value1", "key2": "value2"}'

Code coverage

    >
    > npm test
    >
    > environment-override@0.1.3 test /.../environment-override
    > istanbul cover _mocha --dir ../coverage/environment -- --no-timeouts -R dot test/tests/



      ․․․․․․․․․․

      10 passing (14ms)

    =============================================================================
    Writing coverage object [./coverage/coverage.json]
    Writing coverage reports at [./coverage]
    =============================================================================

    =============================== Coverage summary ===============================
    Statements   : 100% ( 21/21 )
    Branches     : 100% ( 12/12 )
    Functions    : 100% ( 1/1 )
    Lines        : 100% ( 21/21 )
    ================================================================================

Keywords

FAQs

Package last updated on 19 Jan 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