Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Probably the sole command line option parser you'll ever need to Ctrl+C, Ctrl+V. Proof:npm install optjs
function opt(argv) {
var opt={},arg,p;argv=Array.prototype.slice.call(argv||process.argv);for(var i=2;i<argv.length;i++)if(argv[i].charAt(0)=='-')
((p=(arg=(""+argv.splice(i--,1)).replace(/^[\-]+/,'')).indexOf("="))>0?opt[arg.substring(0,p)]=arg.substring(p+1):opt[arg]=true);
return {'node':argv[0],'script':argv[1],'argv':argv.slice(2),'opt':opt};
}
var opt = require("optjs")();
console.log(opt.node); // Path to node executable
console.log(opt.script); // Path to the current script
console.log(opt.opt); // Command line options as a hash
console.log(opt.argv); // Remaining non-option arguments
node somescript.js foo -a=1 -b --c="hello world" bar ----d
// Result
opt.node == "/path/to/node[.exe]"
opt.script == "/path/to/somescript.js"
opt.opt == { a: 1, b: true, c: "hello world", d: true }
opt.argv == ["foo", "bar"]
#!/usr/bin/env node
console.log(require("./opt.js")());
MIT
FAQs
Probably the sole command line option parser you'll ever need to...
The npm package optjs receives a total of 149,331 weekly downloads. As such, optjs popularity was classified as popular.
We found that optjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.