
Security News
OpenClaw Skill Marketplace Emerges as Active Malware Vector
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.
@davidosborn/getopt
Advanced tools
A parser of command-line arguments for modern JavaScript.
You can import getopt as a module to parse the arguments of a JavaScript program.
Look at the following example for how to use this module.
'use strict'
import process from 'process'
import getopt, {usage} from '@davidosborn/getopt'
main(process.argv.slice(2))
function main(args) {
// Parse the arguments.
let opts = getopt(args, {
options: [
{
short: 'h',
long: 'help',
description: 'Display this usage information and exit.',
callback: usage
},
{
short: 'o',
long: 'output',
argument: 'file',
description: 'Write to the specified file.'
},
{
short: 'q',
long: 'quiet',
description: 'Do not write to the console.'
},
{
short: 'v',
long: 'verbose',
description: 'Write extra information to the console.'
}
],
usage: {
footer: 'Header content',
header: 'Footer content',
program: 'example',
spec: '[option]... <input-file>...'
},
callback: function(opts, args, settings) {
// Show the usage when there is no input.
if (opts.parameters.length < 1 || !opts.parameters[0].value)
usage(settings)
}
})
// Use the parsed arguments.
let sources = opts.parameters.map(function(p) {return p.value})
let destination = opts.options.output?.value
if (opt.options.verbose)
console.log('Verbose output!');
}
You can run getopt from the command line to parse the arguments of a shell script.
The first argument must be a path to a JSON file that contains the settings.
The remaining arguments will be parsed according to the settings.
This particular use case is more of a toy for now.
FAQs
A full-featured parser for command-line arguments
We found that @davidosborn/getopt 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
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.