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

compare-env-keys

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

compare-env-keys

A simple script you can use in your package.json to make sure that all the keys in a dotenv file are present in other dotenv files.

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

compare-env-keys

A simple script you can use in your package.json to make sure that all the keys in a dotenv file are present in other dotenv files.

The use case for this is to run this script before you deploy a website or web application where you just to make sure your staging.env or production.env dotenv files have all the environment variables that are present in a local.env.

This helps prevent a deploy that fails in staging or production because an environment variable is missing.

Install

Install with npm:

$ npm install --save-dev compare-env-keys

Install with yarn:

$ yarn add --dev arr-diff compare-env-keys

Usage

In your package.json, add to scripts:

{
  // ...
  "scripts": {
    "predeploy:staging": "compare-env-keys env/local.env env/staging.env",
    "predeploy:production": "compare-env-keys env/local.env env/production.env",
    "predeploy:all": "compare-env-keys env/local.env env/staging.env env/production.env"
  }
}

FAQs

Package last updated on 21 Nov 2022

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