0.0.8 • Published 6 years ago

stupid-env v0.0.8

Weekly downloads
14
License
MIT
Repository
github
Last release
6 years ago

stupid-env

A cli for checking, fast switching, and persisting environment variables

stupid-env NPM downloads

English | 简体中文

Getting started

npm install -g stupid-env

Usage

stupidenv -h               # help
  stupidenv -l             # list all environments
  stupidenv -a             # list all environments and choose one
  stupidenv -s             # choose an available environment directly
  stupidenv -o ./.env.json # specify environment variable persistence file,default: ./.env.json

Once you have selected an environment, the corresponding environment variables will be properly persisted.

// You need to properly configure the `.stupidenv.js` file in the project root directory.
module.exports = [
  {
    name: '182',
    api: 'https://192.168.100.182',
    env: {
      CDN_URL: 'https://192.168.100.182/cdn', // other environment variables that need to be set together
    },
    healthcheck: {
      path: '/dce/healthz', // default: '/'
      headers: {
        token: 'mytoken',
      },
      isHealthy: function (res) {
        return res.data === 'Healthy';
      },
      timeout: 2000, // default: 2000 ms
    },
  },
  {
    name: '100',
    api: 'https://192.168.100.100',
    healthcheck: {
      path: '/dce/healthz',
    },
  },
];
0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5-rc1

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago