D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
alt-nodejs22
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
nopt
/
bin
/
Filename :
nopt.js
back
Copy
#!/opt/alt/alt-nodejs22/root/usr/bin/node const nopt = require('../lib/nopt') const path = require('path') console.log('parsed', nopt({ num: Number, bool: Boolean, help: Boolean, list: Array, 'num-list': [Number, Array], 'str-list': [String, Array], 'bool-list': [Boolean, Array], str: String, clear: Boolean, config: Boolean, length: Number, file: path, }, { s: ['--str', 'astring'], b: ['--bool'], nb: ['--no-bool'], tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'], '?': ['--help'], h: ['--help'], H: ['--help'], n: ['--num', '125'], c: ['--config'], l: ['--length'], f: ['--file'], }, process.argv, 2))