Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 1, 2024 via pnpm

argparse 1.0.8

Very powerful CLI arguments parser. Native port of argparse - python's options parsing library
Package summary
Share
5
issues
3
high severity
license
2
meta
1
2
low severity
license
2
6
licenses
22
MIT
10
ISC
5
BSD-2-Clause
6
other licenses
BSD-3-Clause
3
BSD
2
BSD-3-Clause OR MIT
1
Package created
16 May 2012
Version published
29 Sep 2016
Maintainers
1
Total deps
43
Direct deps
2
License
MIT

Issues

5

3 high severity issues

high
Recommendation: Validate that the package complies with your license policy
via: istanbul@0.4.5
Recommendation: Validate that the package complies with your license policy
via: istanbul@0.4.5
via: istanbul@0.4.5
Collapse
Expand

2 low severity issues

low
Recommendation: Read and validate the license terms
via: istanbul@0.4.5
Recommendation: Read and validate the license terms
via: istanbul@0.4.5
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
22 Packages, Including:
argparse@1.0.8
async@1.5.2
balanced-match@1.0.2
brace-expansion@1.1.11
concat-map@0.0.1
deep-is@0.1.4
fast-levenshtein@2.0.6
handlebars@4.7.8
has-flag@1.0.0
js-yaml@3.14.1
levn@0.3.0
minimist@1.2.8
mkdirp@0.5.6
neo-async@2.6.2
optionator@0.8.3
path-is-absolute@1.0.1
prelude-ls@1.1.2
resolve@1.1.7
supports-color@3.2.3
type-check@0.3.2
word-wrap@1.2.5
wordwrap@1.0.0

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
abbrev@1.0.9
glob@5.0.15
inflight@1.0.6
inherits@2.0.4
isexe@2.0.0
minimatch@3.1.2
nopt@3.0.6
once@1.4.0
which@1.3.1
wrappy@1.0.2

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
escodegen@1.8.1
esprima@2.7.3
esprima@4.0.1
esutils@2.0.3
uglify-js@3.17.4

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
istanbul@0.4.5
source-map@0.6.1
sprintf-js@1.0.3

BSD

Invalid
Not OSI Approved
2 Packages, Including:
estraverse@1.9.3
source-map@0.2.0

BSD-3-Clause OR MIT

Permissive
1 Packages, Including:
amdefine@1.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of argparse 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
istanbul0.4.592.79 kBBSD-3-Clause
prod
3
2
sprintf-js1.0.310.09 kBBSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does argparse do?

Argparse is a Command Line Interface (CLI) argument parser for Node.js, and is a native port of Python's argparse module. This package is designed to facilitate the parsing of command line arguments in your Node.js applications. Argparse supports sub-commands, similar to its original Python counterpart, and conveniently offers similar functionality in a JavaScript environment.

How do you use argparse?

Utilizing argparse in your Node.js application requires importing the ArgumentParser object from the 'argparse' module and using its methods to define the arguments your application expects. Here's a basic usage example:

#!/usr/bin/env node
'use strict';

const { ArgumentParser } = require('argparse');
const { version } = require('./package.json');

const parser = new ArgumentParser({
  description: 'Argparse example'
});

parser.add_argument('-v', '--version', { action: 'version', version });
parser.add_argument('-f', '--foo', { help: 'foo bar' });
parser.add_argument('-b', '--bar', { help: 'bar foo' });
parser.add_argument('--baz', { help: 'baz bar' });

console.dir(parser.parse_args());

In this example, the script accepts several optional arguments. Users can invoke the script with these flags followed by their respective values from the command line as follows:

$ ./test.js -f=3 --bar=4 --baz 5
{ foo: '3', bar: '4', baz: '5' }

The parser.parse_args() method parses the arguments and returns an object mapping argument names to their given values.

Where are the argparse docs?

The Argparse documentation can be found referenced in the original Python's argparse documentation and the original Python argparse tutorial. Additionally, you can also find more details including the difference with Python's argparse in the 'doc' directory of the argparse GitHub repository.