sixargs

Ultra-minimalist nodejs command-line arg parser taking advantage of ES6 destructuring for mapping and defaults.

Usage no npm install needed!

<script type="module">
  import sixargs from 'https://cdn.skypack.dev/sixargs';
</script>

README

sixargs

minimalist node command line arg parser

usage:

//test.js
const {
  n:name = 'sixargs',
  v:version = '1.0'
} = require('./sixargs')

console.log(`My name is ${name} and my version is ${version}`)
node test -n foo -v 2.0   #My name is foo and my version is 2.0
node test -n=bar -v=3.0   #My name is bar and my version is 3.0

node test                 #My name is sixargs and my version is 1.0