Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
cli-defaults
Advanced tools
Add default answers to your command line script.
This module will provide these options by default:
Default commands:
% ./example.js
% ./example.js --version
0.1.0
% ./example.js --help
Any cli tool should provide these options
usage: cli-defaults [options]
--help prints this message
--version prints package version
You can add custom commands:
% ./example.js --ping
pong
% ./example.js --echo 'hello world'
hello world
% ./example.js --double 42
84
% npm install --save cli-defaults
const argv = require('minimist')(process.argv.slice(2))
const CLI = require('cli-defaults')
const c = new CLI({
ping: () => console.log('pong')
})
c.answer(argv)
provides default commands (help, version) + one custom 'ping' command
For more details check example.js and test/index.test.js
FAQs
Any cli tool should provide these options
The npm package cli-defaults receives a total of 1 weekly downloads. As such, cli-defaults popularity was classified as not popular.
We found that cli-defaults 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.