1.0.1 • Published 2 months ago

@jonshort/cenv v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

cenv-wasm

npm version

usage

Using a comment pattern in your .env files, easily swap between envs in local development.

Installation

Install globally via. npm

npm install -g @jonshort/cenv

Usage

  1. Add the "cenv" pattern to your .env file
VARIABLE_1=something

# ++ local ++
# API_ADDRESS=http://localhost:5000
# REQUIRE_LOGIN=false

# ++ live ++
# API_ADDRESS=https://myliveapi.com
# REQUIRE_LOGIN=true
  1. Run cenv, choosing an env keyword to use
cenv live
  1. Check your .env, the keyworded env vars will now be uncommented
VARIABLE_1=something

# ++ local ++
# API_ADDRESS=http://localhost:5000
# REQUIRE_LOGIN=false

# ++ live ++
API_ADDRESS=https://myliveapi.com
REQUIRE_LOGIN=true

Use via. npx

You can also run this cli via. npx which avoids having to install it globally, e.g:

npx @jonshort/cenv keyword

Uninstalling

  1. Check globally installed packages
npm ls -g
  1. Uninstall the package
npm uninstall -g @jonshort/cenv

Development

How to build the internals

  1. Install wasm-pack
cargo install wasm-pack
  1. Build with the target of nodejs
wasm-pack build --target nodejs
  1. Check the pkg/ folder - this is the compiled wasm
  2. Once built run node index.js and check everything is working as expected

How to publish the package

  1. Build the internals as above
  2. Remove the .gitignore file within the pkg/ folder
rm pkg/.gitignore

!IMPORTANT The above is extremely important - JS snippets won't be included otherwise 3. Do a dry-run publish and check the files are as expected

npm publish --dry-run
  1. Publish as normal
npm publish
1.0.1

2 months ago

1.0.0

2 months ago

0.1.0

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.4-beta.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago