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

clarg

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

clarg

Simple command line argument parser


Version published
Weekly downloads
923
decreased by-10.65%
Maintainers
1
Weekly downloads
 
Created
Source

clarg

The simplest command-line parsing utility for node.js

Why create another library for this?

All of the existing libraries (i.e. commander or nomnom) require you to specify upfront what options you expect.

Clarg simply returns you a full set of arguments it found allowing you to bind everything in any way you want, anywhere you want.

Usage

Simply import clarg anywhere in your code and it will output an object. You don't have to specify any options upfront, just require this module and execute it. It doesn't matter where in code you run it - you will always get the same result which is really just a broken down list of arguments and options passed to the process.

var clarg = require('clarg');

var arguments = clarg();

// node index.js start --debug --format long
// => {args: ['start'], opts: [{debug: true, format: 'long'}]}

FAQs

Package last updated on 22 Sep 2016

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