New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

clean-env

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

clean-env

Ensure the correct env variables are being used for production builds

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

clean-env

NPM

Ensure the correct env variables are being used for production builds

Installation

npm install clean-env --save-dev

Usage

Config

Create a JavaScript, JSON or YAML file, or skip the config an embed in the package.json file under the key clean-env.

If you make a file, it must be one of the following names and stored in the root of the project folder:

  • .clean-env.js
  • .clean-env.json
  • .clean-env.yaml
  • .clean-env.yml

Then add any key to over write these defaults:

{
    "required": [],
    "excluded": [],
    "dotenv": ".env",
}

dotenv

If you need to privide an alternative path to your .env file, then over write the dotenv key in the config with the correct name, relative to the root of the project.

{
    dotenv: './config/.env'
}

If you would like to not load the .env file before checking the ENV for variables, then change the dotenv key to false.

dotenv: false

Translations

If you require a translated version of this script or would like to change the wording of any of the error messages, then add a translations key to the config and over write any of these defaults:

translations:
    missingRequired: "Clean ENV did not find the following required ENV variables."
    foundExcluded: "Clean ENV has found the following excluded ENV variables in the ENV."
    errorStatement: "Your ENV is not in a clean state."
    errorQuestion: "Are you sure you want to continue with the build? (y)"
    yes: "y"

Contributing

  • Fork it on Github https://github.com/alexbbt/node-clean-env
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request against the development branch :D

FAQs

Package last updated on 21 Mar 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