npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bringenvironmentvariablesfromapp

v1.0.2

Published

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

Downloads

6

Readme

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).