
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
@bitjson/npm-scripts-info
Advanced tools
Display the description of your npm scripts.
This module is installed via npm:
npm install npm-scripts-info --save
scripts-info
propertyAdd the descriptions (scripts-info
) to your package.json
. Afterwards, add npm-scripts-info
to your scripts.
{
"name": "my-project",
"scripts": {
"info": "npm-scripts-info"
},
"scripts-info": {
"info": "Displays information about the scripts.",
"watch:build": "Compiles the scripts and watches for changes.",
"start": "Kickstarts the application."
}
}
Finally, run npm run info
.
?
For modules with dozens of scripts it might be a better option to store the descriptions near the commands. npm-scripts-info
allows to store the scripts descriptions in the scripts
property. In order to add a script description, just prefix its name with ?
.
{
"name": "my-project",
"scripts": {
"?info": "Display information about the scripts.",
"info": "npm-scripts-info",
"?watch:build": "Watch codebase, trigger build when source code changes",
"watch:build": "webpack --watch",
"?start": "echo Kickstarts the application.",
"start": "node index"
}
}
Have you noticed the echo
command in the start
description? Hence the descriptions are inside the script property, they can be called using npm run
. By adding the echo
command to the description properties you can make valid scripts from them. Therefore, running npm run ?start
will print the description of the start
script. And the great thing is, npm-scripts-info
is smart enough to fetch the description from the echo
command!
NOTE: The prefixed commands will be looked up for descriptions only if the package.json
doesn't have a scripts-info
property.
You can customize the output by specifying a reporter.
npm-scripts-info -r=my-reporter
You can check the default reporter to get the gist of how it works. It's very simple.
Note: If you're publishing your own reporter, please prefix it with npm-scripts-info
(e.g., npm-scripts-info-my-reporter
) for searchability.
You can fetch the scripts descriptions from a package.json
in JavaScript.
'use strict';
var getScriptsInfo = require('npm-scripts-info');
var readPkgUp = require('read-pkg-up');
readPkgUp()
.then(function(result) {
var scriptsInfo = getScriptsInfo(result.pkg);
console.log(scriptsInfo);
//> { md: 'Update the markdown files',
// info: 'Display information about the scripts',
// test: 'Run the tests' }
});
Some of the npm scripts are standardized. npm-scripts-info
provides default descriptions for them, if no custom description specified in scripts-info
.
ISC © Kier Borromeo
FAQs
Display the description of your npm scripts.
The npm package @bitjson/npm-scripts-info receives a total of 7,558 weekly downloads. As such, @bitjson/npm-scripts-info popularity was classified as popular.
We found that @bitjson/npm-scripts-info 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.