Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@hypernym/args
Advanced tools
A fast and ultra lightweight CLI argument parser.
Repository | Package | Releases | Discussions
npm i -D @hypernym/args
Unprefixed inputs are stored in an array.
$ arg
# => { _: ['arg'] }
$ arg-a arg-b arg-c
# => { _: ['arg-a', 'arg-b', 'arg-c'] }
Inputs with --
prefix are parsed as flags.
By default, standalone flags with no value are defined as true
.
$ --flag
# => { _: [], flag: true, }
$ --flag value
# => { _: [], flag: 'value', }
Inputs with -
prefix are parsed as aliases.
By default, standalone aliases with no value are defined as true
.
$ -alias
# => { _: [], alias: true, }
$ -alias value
# => { _: [], alias: 'value', }
--
and -
=
$ --flag=value -- arg=value - -alias=value
# => { _: [] }
$ hello world --foo bar -baz -cli demo --fuz
import { createArgs } from '@hypernym/args'
interface Args {
foo?: string
baz?: boolean
cli?: string
fuz?: boolean
}
const args = createArgs<Args>()
console.log(args)
/* Output:
{
_: ['hello', 'world'],
foo: 'bar',
baz: true,
cli: 'demo',
fuz: true
}
*/
string[]
process.argv.slice(2)
const args = createArgs({
argv: process.argv.slice(2),
})
object
undefined
const args = createArgs({
alias: {
config: ['conf', 'c'],
help: 'h',
},
})
Feel free to use the official discussions for any additional questions.
Developed in 🇭🇷 Croatia
Released under the MIT license.
© Hypernym Studio
FAQs
A fast and ultra lightweight CLI argument parser.
The npm package @hypernym/args receives a total of 5 weekly downloads. As such, @hypernym/args popularity was classified as not popular.
We found that @hypernym/args demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.