You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

arg-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arg-parser - npm Package Compare versions

Comparing version

to
2.0.0

index.js

9

package.json
{
"name": "arg-parser",
"version": "1.2.0",
"version": "2.0.0",
"description": "node cli arguments parser",

@@ -8,6 +8,7 @@ "author": {

},
"main": "arg-parser",
"type": "module",
"main": "index",
"dependencies": {},
"engines": {
"node": ">=0.8.0"
"node": ">=18.0.0"
},

@@ -20,3 +21,3 @@ "keywords": [

{
"type": "MIT",
"type": "GPL-3.0-or-later",
"url": "https://raw.github.com/tborychowski/node-arg-parser/master/LICENSE"

@@ -23,0 +24,0 @@ }

@@ -8,17 +8,22 @@ node-arg-parser

Install
-------
npm install arg-parser
## Install
```sh
npm install arg-parser
```
Example
--------
## Example
**test.js**
````javascript
var Args = require('arg-parser'),
args = new Args('ArgParserTester', '1.0', 'NodeJS arg-parser module tester',
'In addition to these parameters - more info here...');
```js
import Args from 'arg-parser';
const args = new Args(
'ArgParserTester',
'1.0',
'NodeJS arg-parser module tester',
'In addition to these parameters - more info here...'
);
args.add({ name: 'input', desc: 'input file', switches: [ '-i', '--input-file'], value: 'file' });

@@ -31,29 +36,27 @@ args.add({ name: 'output', desc: 'output file', switches: [ '-o', '--output-file'], value: 'file' });

if (args.parse()) console.log(args.params);
````
```
**Run test.js**
node test.js -h
```sh
node test.js -h
```
**Output**
NodeJS arg-parser module tester
usage: test [options] <text>
```
NodeJS arg-parser module tester
usage: test [options] <text>
<text> text to store
<text> text to store
-V, --verbose verbose mode
-h, --help display help & usage
-i, --input-file=FILE input file
-o, --output-file=FILE output file
-q, --quiet quiet mode
-v, --version display cli name & version
-V, --verbose verbose mode
-h, --help display help & usage
-i, --input-file=FILE input file
-o, --output-file=FILE output file
-q, --quiet quiet mode
-v, --version display cli name & version
In addition to these parameters - more info here...
In addition to these parameters - more info here...
License
-------
*MIT*
```

@@ -1,6 +0,6 @@

var Args = require('./arg-parser.js'), args;
import Args from './index.js';
args = new Args('ArgParserTester', '1.0', 'NodeJS arg-parser module tester',
const args = new Args('ArgParserTester', '1.0', 'NodeJS arg-parser module tester',
'In addition to these parameters - more info here...');
args.add({ name: 'input', desc: 'input file', switches: [ '-i', '--input-file'], value: 'file' });

@@ -7,0 +7,0 @@ args.add({ name: 'output', desc: 'output file', switches: [ '-o', '--output-file'], value: 'file' });

Sorry, the diff of this file is not supported yet