GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kotborealis/chen: :smiley_cat: Node.JS tool to parse cli arguments, enviroment variables and load configs from .js files

BranchesTags
Open more actions menu

Latest commit

 

History

59 Commits
59 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
img
img
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 

Repository files navigation

Cheeen~

Chen.js 😺

😺 Node.JS tool to parse cli arguments, enviroment variables and load configs from .js files

CLI arguments parser

// Called with args:
// --prop 100 --flag -abc input output --type="pdf document" -- "more unnamed args" -not-a-a-flag

require('chen.js').args();

/**
{
	_: ['input', 'output', 'more unnamed args', '-not-a-a-flag'],
	prop: 100,
	flag: true,
	a: true,
	b: true,
    c: true,
	type: 'pdf document',
}
**/

Config loader

/**
* Loads `${PWD}/.config.js` by default
*/
const config = require('chen.js').config();
/**
* Loads `${PWD}/.cfg.js`
*/
const config = require('chen.js').config('.cfg.js');
/**
* Loads `${PWD}/.config.js`
* Loads `${PWD}/.config.dev.js` and overrides previous config
*/
const config = require('chen.js').config(['.config.js', '.config.dev.js']);
/**
* Assuming called with CLI args: --config=.config.dev.js
* Loads `${PWD}/.config.js`
* Loads `${PWD}/.config.dev.js` and overrides previous config
*/
const config = require('chen.js').config();
/**
* Assuming called with CLI args: --config=.config.dev.js --config=.config.dev2.js
* Loads `${PWD}/.config.js`
* Loads `${PWD}/.config.dev.js` and overrides previous config
* Loads `${PWD}/.config.dev2.js` and overrides previous config
*/
const config = require('chen.js').config();

Env parser

Loads and parses environment variables and .env files (via dotenv package).

const env = require('chen').env();

About

😺 Node.JS tool to parse cli arguments, enviroment variables and load configs from .js files

awooo.ru/

Topics

argschencliconfigenvjsnodejs

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.