args-flags
v1.1.1
Published
A simple command line argument parser.
Downloads
465
Readme
args-flags
A simple command line argument parser.
Install
yarn add args-flags
npm install args-flags
Usage
{
"scripts": {
"build": "node scripts/build.js README.mdx > README.md"
}
}
Now we have access to the arguments and flags in scripts/build.js
derived from process.argv
:
#!/bin/env node
import { args, flags } from 'args-flags'
import { watch } from 'chokidar'
const [optionOne, optionTwo] = args
if (flags.watch) {
watch('./src').on('change', () => {
console.log('source changed')
})
}