args-flags
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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')
  })
}

Readme

Keywords

none

Package Sidebar

Install

npm i args-flags

Weekly Downloads

89

Version

1.1.1

License

MIT

Unpacked Size

1.59 kB

Total Files

4

Last publish

Collaborators

  • souporserious