
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A small and minimal CLI framework
Install the package using NPM:
npm install nutty
//Import nutty
var nutty = require('nutty');
//Set the CLI name
nutty.set('name', 'hello');
//Set the CLI description
nutty.set('description', 'Say hello');
//Set the CLI version
nutty.set('version', '1.0.0');
//Use a middleware
nutty.use(function(args, next)
{
//Get the name
var name = args.arguments[0];
//Get the hello word
var hello = (args.options.idiom === 'spanish') ? 'Hola' : 'Hello';
//Display in console
console.log('>>>>>>> ' + hello + ' ' + name + '!');
});
//Run the CLI
nutty.run();
Simple usage:
$ hello John
>>>>>>> Hello John!
Use it with options:
$ hello Susan --idiom spanish
>>>>>>> Hola Susan!
Assigns the value of the setting variable called key to value.
nutty.set('name', 'my-app'); //Initialize the 'name' variable to 'my-app'
nutty.get('name'); //--> Return: ' my-app'
| key | description | type | default |
|---|---|---|---|
| name | The CLI name | string | '' |
| description | The CLI description | string | '' |
| version | The CLI version | string | '' |
Returns the value of the setting variable called key.
Add a new middleware to the CLI. Nutty is based on middlewares, that are functions that have access to the arguments object and the next function.
Example:
nutty.use(function(args, next)
{
// Do your magic
// ....
//Next middleware
return next();
});
Args is an object with all the arguments of the CLI. It has the following keys:
args.options: an object with all the options with the format key = value.args.arguments: a list with all the arguments that didn't have an option associated with them.Example:
myapp argument1 argument2 --option1 argument3 --option2 --option3 3.123
Then the args object will has the following structure:
{
"arguments": [ "argument1", "argument2" ],
"options":
{
"option1": "argument3",
"option2": true,
"option3": "3.123"
}
}
The next argument is a function that will call the next middleware on the list when is invoked.
Run the CLI.
MIT LICENSE.
FAQs
A small and minimal CLI framework
We found that nutty 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.