Socket
Socket
Sign inDemoInstall

args-flags

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

args-flags

A simple command line argument parser.


Version published
Weekly downloads
143
increased by110.29%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 23 Apr 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc