Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

argufy

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argufy

Parse command line arguments to Node.js CLI programs.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129
increased by21.7%
Maintainers
1
Weekly downloads
 
Created
Source

argufy

npm version

yarn add -E argufy

argufy will parse command line arguments to Node.js CLI programs.

API

The package assumes that the arguments begin from the 3rd position, i.e.,

node example.js --title "Hello World"

argufy(config, argv):object

The flags from the arguments will be extracted according to the configuration object.

import argufy from 'argufy'

const config = {
  title: { short: 't', command: true },
  list: { short: 'l', boolean: true },
  app: 'a',
  delay: 'y',
  file: 'f',
  wait: { short: 'w', number: true },
  'no-empty': 'e',
  resize: 'z',
  colors: 'c',
  dir: 'D',
}

const res = argufy(config, process.argv)
console.log(res)
node example.js --title "Hello World" -w 10 -l -app Argufy
# or
node example.js "Hello World" -w 10 -l -app Argufy
{ title: 'Hello World', list: true, app: 'Argufy', wait: 10 }

(c) artdecocode 2018

Keywords

FAQs

Package last updated on 12 Jun 2018

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