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

bringenvironmentvariablesfromapp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bringenvironmentvariablesfromapp

Module to set up local process to point to a different environment.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

node-js-environment-variable-setter

This module can used in Node JS applications to mimic the environment variables used in a different environment

To test this module, run the following commands:

  • yarn install
  • yarn test

#Usage

##Downloading environment variables file In the module where the functional tests will be run, you need to firstly download the json file with the environment variable configurations. This file can be found in the Azure project of which environment variables you want to mimic locally. For example, this is the URL for the environment variables file for the RFE project in AAT:

https://div-rfe-aat.scm.service.core-compute-aat.internal/api/settings

In order to log in, you'll have to enter your SCM credentials. These can be registered in Azure. Once you have access to this file, just save it as a json file anywhere in your computer. If you choose to save it in your project, don't forget to add this file to .gitignore so that you don't check this into GitHub (exposing secrets).

##Installing the package in your project To install this as a dev dependency in your project, just run:

yarn add "https://github.com/hmcts/node-js-environment-variable-setter#0.2" -D

##Having environment variables changed on the fly for your test

const processEnvironmentSetup = require('@hmcts/node-js-environment-variable-setter');

const configurationFile = './remote-config.json'; //This will be the path to the file you saved with the environment variables
processEnvironmentSetup.setUpEnvironmentVariables(configurationFile);

From this point onwards, your project will have the same environment variables set in the json file (with the exception of the ignored properties - you can find this list in this module's source code).

FAQs

Package last updated on 21 Oct 2019

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