Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
byp
/
izo
/
con7ext_sym404
/
rintoar.txt
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
@pkgjs
/
parseargs
/
examples
:
simple-hard-coded.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
'use strict'; // This example is used in the documentation. // 1. const { parseArgs } = require('node:util'); // from node // 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package const { parseArgs } = require('..'); // in repo const args = ['-f', '--bar', 'b']; const options = { foo: { type: 'boolean', short: 'f' }, bar: { type: 'string' } }; const { values, positionals } = parseArgs({ args, options }); console.log(values, positionals); // Try the following: // node simple-hard-coded.js