
Security News
n8n Tops 2025 JavaScript Rising Stars as Workflow Platforms Gain Momentum
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.
@lukecjohnson/args
Advanced tools
A fast command-line argument parser with type checking, shorthand flags, default values, and help text generation
A fast command-line argument parser with type checking, shorthand flags, default values, and help text generation
npm install @lukecjohnson/args
Note: @lukecjohnson/args is an ESM-only package
parseArgs accepts an options object that can be used to define flags and
customize its behavior. The following options are available:
flags: An object defining the flags the program or command accepts. Each
entry's key is a flag name that can be used with a double hyphen on the
command line (--example) and its value is an object further describing the
flag with the following properties:
type: A string indicating the expected type of the flag's value
("string", "number", or "boolean")default: The default value assigned to the flag if no value is provided by
the end-usershorthand: A single-letter alias that can be used with a single hyphen on
the command linedescription: A short description of the flag to be included in the
generated help textargv: An array of raw arguments to be parsed (Default: process.argv.slice(2))usage: The general usage pattern of the program or command to be included
in the generated help textdisableHelp: When true, the built-in --help and -h flags are
disabled (Default: false)stopAtPositional: When true, all arguments after the first positional,
non-flag argument are pushed to result.args (Default: false)parseArgs returns an object containing args and flags:
args: An array of non-flag arguments provided by the end-userflags: An object containing the values of flags provided by the end-user or
their default valuesimport parseArgs from '@lukecjohnson/args';
const { args, flags } = parseArgs({
flags: {
host: {
type: 'string',
description: 'Hostname to bind',
default: 'localhost',
},
port: {
type: 'number',
shorthand: 'p',
description: 'Port to bind',
default: 3000,
},
debug: {
type: 'boolean',
shorthand: 'd',
description: 'Show debugging information',
default: false,
}
},
usage: 'node serve.js [directory] [flags]'
});
console.log({ args, flags });
$ node serve.js public --host 0.0.0.0 --port=8080 -d
{
args: ['public'],
flags: {
host: '0.0.0.0',
port: 8080,
debug: true
}
}
$ node serve.js --help
Usage:
node serve.js [directory] [flags]
Flags:
--host Hostname to bind (Default: "localhost")
-p, --port Port to bind (Default: 3000)
-d, --debug Show debugging information (Default: false)
@lukecjohnson/args 4,693,263 ops/sec ±0.31% (98 runs sampled)
arg 2,484,276 ops/sec ±0.38% (98 runs sampled)
mri 1,547,159 ops/sec ±0.35% (99 runs sampled)
minimist 629,555 ops/sec ±0.31% (99 runs sampled)
command-line-args 158,831 ops/sec ±0.34% (97 runs sampled)
yargs-parser 73,104 ops/sec ±0.34% (96 runs sampled)
See /benchmark for benchmark details
FAQs
A fast command-line argument parser with type checking, shorthand flags, default values, and help text generation
We found that @lukecjohnson/args 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
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.