Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
commander-version
Advanced tools
A wrapper for Commander that automatically sets the version based on your package.json
A wrapper for Commander that automatically sets the version based on your package.json.
yarn add commander-version
npm install commander-version
To set the version, import program
the same as you would for Commander, just pass __dirname
:
import program from "commander-version";
program(__dirname)
.name("my-program")
.description("...")
// ...
.parse();
This creates a new Command rather than using the global Command, which can cause issues.
You can also add flags or descriptions the same as with program.version()
:
Note: the default flags are set to "-v --version" to be inline with other programs, such as Node.js.
import program from "commander-version";
// To set flags back to the Commander default of "-V --version", for example:
program(__dirname, "-V --version", "custom version description")
.name("my-program")
.description("...")
// ...
.parse();
For creating types, the Commander namespace can also be imported:
import { commander } from "commander-version";
type MyType = commander.Command;
For convenience, Commander and createCommand can also be used without setting the version:
import { commander, createCommand } from "commander-version";
new commander.Command("my-command")
.description("...")
// ...
const myCommand = createCommand("my-command")
.description("...")
// ...
FAQs
A wrapper for Commander that automatically sets the version based on your package.json
We found that commander-version 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.