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.
@jill64/ts-cli
Advanced tools
> Solidly-Typed CLI Router
npm i @jill64/ts-cli
import { App } from '@jill64/ts-cli'
new App(
{
args: [
['arg1', 'Argument 1'],
['arg2', 'Argument 2'],
['arg3', 'Argument 3']
],
options: {
verbose: {
alias: 'V',
description: 'Verbose output'
},
host: {
alias: 'h',
description: 'Host name',
type: 'string'
}
},
optional: [
['optional-1', 'Optional Argument 1'],
['optional-2', 'Optional Argument 2'],
['optional-3', 'Optional Argument 3']
],
rest: {
placeholder: 'rest-argument',
description: 'Rest Argument'
},
codes: {
0: success,
1: failure
}
},
({ args, options, optional, rest }) => {
// `<command> <arg1> <arg2> <arg3> [options] [optional1?] [optional2?] [optional3?] <...rest>`
options.verbose // boolean
options.host // string
// Allow 0 or 1 or void
return 0
}
)
The add
function defines a route.
import { App } from '@jill64/ts-cli'
new App(/* ... */)
.add(
'test',
{
// Config
},
() => {
// `<command> test`
// ...
}
)
.add(
'test start',
{
// Config
},
() => {
// `<command> test start`
// ...
}
)
The run
function executes the command immediately using process.argv
.
import { App } from '@jill64/ts-cli'
import process from 'node:process'
new App(/* ... */).run(process.argv)
// index.js
import { App } from '@jill64/ts-cli'
export const command = new App(/* ... */).add(/* ... */).add(/* ... */)
import { command } from 'index.js'
// `example`
command.execute({
args: {
arg1: 'value1',
arg2: 'value2',
arg3: 'value3'
},
optional: {
'optional-1': 'optional-value1',
'optional-2': 'optional-value2',
'optional-3': 'optional-value3'
},
// or
// rest: ['rest1', 'rest2', 'rest3'],
options: {
verbose: true,
host: 'example.com'
}
})
// `example test`
command.invoke.test({
// ...
})
// `example test start`
command.invoke['test start']({
// ...
})
FAQs
> Solidly-Typed CLI Router
The npm package @jill64/ts-cli receives a total of 926 weekly downloads. As such, @jill64/ts-cli popularity was classified as not popular.
We found that @jill64/ts-cli demonstrated a healthy version release cadence and project activity because the last version was released less than 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.