Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
@jill64/ts-cli
Advanced tools
Readme
> 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
Unknown package
The npm package @jill64/ts-cli receives a total of 1,355 weekly downloads. As such, @jill64/ts-cli popularity was classified as 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.
Research
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.