1.0.1 • Published 4 years ago

auto-update-env v1.0.1

Weekly downloads
9,609
License
MIT
Repository
github
Last release
4 years ago

auto-update-env

License NPM Downloads

Installation

# If you are using Yarn
$ yarn add auto-update-env --dev

# If you are using NPM
$ npm install auto-update-env --save-dev

Usage

To make sure that this module run properly, make sure you add the required files beforehand.

  1. Create a file envcheck.js in your root directory.

    # Load the package
    const aue = require('auto-update-env');
    
    # (Optional) Check whether the command include auto-add command
    const flag =  process.argv.includes('-f') || process.argv.includes('--fix');
    
    # In this case, .env.sample is the source file and
    # .env is the target file. Please update it accordingly.
    aue.compare(flag, '.env.sample', '.env');
  2. Update your scripts in your package.json file to meet your requirement, for example:

    "scripts": {
      "envcheck": "node envcheck.js",
    },

    Once added, you can simply call it using yarn envcheck or npm run envcheck.

Options

FlagDescriptionUsage Example
--fixAutomatically add the missing variable to your current .envyarn envcheck --fix
-fShortcode for --fixyarn envcheck -f

Version History

VersionDescription
1.0.0Includes update to the code implementation. Now you can leave the default filenames empty. The label on the added keys are now changed from [auto-update-env] to [aue] followed by local time.
0.0.5Added the UTC+0700 time to the label of the newly added keys.
1.0.1

4 years ago

1.0.0

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago