
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
A tool for creating a cli which uses cli options and package.json options and merge them into default options
A tool for creating a cli which uses cli options and package.json options and merge them into default options
npm install --save brutus
var brutus = require('brutus')({
name: 'mycommand',
options: {
foo: "abc",
bar: {},
baz: [100, 200]
},
delegate: {
mergeCliOptionsToPackageOptions: function (cliOptions, pkgOptions) {
// merge options
},
mergePackageOptionsToCommandOptions: function (pkgOptions, cmdOptions) {
// merge options
},
execute: function (cliOptions, cmdOptions) {
// main process
}
}
})
// execute as a cli command (using cli options)
brutus.execAsCli()
The name of the command. This is used as the key of the user's package options.
{
"name": "users-package",
"snowball": {
"foo": "bar"
}
}
If your command name is snowball, then the user's package options are {"foo": "bar"} in the above example.
The default options for the command.
Brutus delegates the merging methods and command execution through delegate object.
| param | type |
|---|---|
| cliOptions | Object |
| pkgOptions | Object |
Merges the user's cli options to the user's package options.
cliOptions is the parsed argv using minimist (i.e. require('minimist')(process.argv.slice(2)) )
| param | type |
|---|---|
| pkgOptions | Object |
| cmdOptions | Object |
Merges the user's package options to the command default options.
pkgOptions are the part of the user's package.json of the key of your command name.
For example, your cmdName is snowball and the user's package.json is like the below:
{
"name": "my-package",
"snowball": {
"foo": "bar"
}
}
Then the pkgOptions are {foo: "bar"}. This is useful when you make your command's behaviour configurable by the user's package.json.
| param | type |
|---|---|
| cliOptions | Object |
| cmdOptions | Object |
Executes the command with cli and command options. The return value of execute becomes the exit code of the cli.
cmdOptions include information merged from the user's cli options and the user's package options using the above 2 methods.
FAQs
A tool for creating a cli which uses cli options and package.json options and merge them into default options
We found that brutus 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.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.