Socket
Socket
Sign inDemoInstall

args-flags

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    args-flags

A simple command line argument parser.


Version published
Weekly downloads
103
decreased by-12.71%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 23 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc