You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

env-install

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

env-install

Install envDependencies from package.json using environment variable replacements

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
81
-13.83%
Maintainers
1
Weekly downloads
 
Created
Source

env-install

Using private git repositories that requires authentication is often necessary when running npm install, but you don't want to put keys, tokens or passwords in your code, so instead you can used this module that allows you to define packages with environment variable names to inject your keys, passwords or tokens.

Usage

Add this module as a dependency in your projects normal dependencies, and add a postinstall script that contains env-install. Then declare your dependencies containing environment variables in envDependencies

scripts: {
    "postinstall": "env-install"
},
dependencies: {
    "env-install": "1.0.0"
},
envDependencies: {
    "some-secret-module": "git+https://${GITHUB_TOKEN}:x-oauth-basic@github.com/you/privaterepo"
}

In the above example some-secret-module will be installed like this:

GITHUB_TOKEN=abcdefg123456
npm install https://abcdefg123456:x-oauth-basic@github.com/you/privaterepo

Keywords

npm

FAQs

Package last updated on 06 Jul 2018

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