All Projects → srph → Npm Scripts Info

srph / Npm Scripts Info

Display the description of your npm scripts

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Npm Scripts Info

Windows Build Tools
📦 Install C++ Build Tools for Windows using npm
Stars: ✭ 3,280 (+3758.82%)
Mutual labels:  build-tool, npm
Vuepack
Publish .vue files in NPM packages
Stars: ✭ 242 (+184.71%)
Mutual labels:  build-tool, npm
Postinstall Build
Helper for conditionally building your npm package on postinstall
Stars: ✭ 87 (+2.35%)
Mutual labels:  build-tool, npm
Ultra Runner
🏃⛰ Ultra fast monorepo script runner and build tool
Stars: ✭ 496 (+483.53%)
Mutual labels:  build-tool, npm
Notes
Some public notes
Stars: ✭ 1,248 (+1368.24%)
Mutual labels:  npm
Webcam Easy
javascript access webcam stream and take photo
Stars: ✭ 79 (-7.06%)
Mutual labels:  npm
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (-8.24%)
Mutual labels:  npm
React Image Timeline
📆 An image-centric timeline component for React.js
Stars: ✭ 77 (-9.41%)
Mutual labels:  npm
Pkgsign
A CLI tool for signing and verifying npm and yarn packages.
Stars: ✭ 85 (+0%)
Mutual labels:  npm
Rambuild
A plugin to make builds in gradle run on ram instead of the hard drive
Stars: ✭ 84 (-1.18%)
Mutual labels:  build-tool
Node Developer Boilerplate
🍭 Boilerplate for ES6+ Node.js and npm Developer
Stars: ✭ 82 (-3.53%)
Mutual labels:  npm
Sbt Dependency Graph
sbt plugin to create a dependency graph for your project
Stars: ✭ 1,223 (+1338.82%)
Mutual labels:  build-tool
Mihomeplus
HomeKit 的 Android 操作代理
Stars: ✭ 83 (-2.35%)
Mutual labels:  npm
Sake Core
Sake's core interface.
Stars: ✭ 78 (-8.24%)
Mutual labels:  build-tool
Motto
Nodejs module environment in golang(based on otto)
Stars: ✭ 84 (-1.18%)
Mutual labels:  npm
Minimal Feedback
🗳 minimal-feedback is a blazingly fast and highly customizable component to get user feedback.
Stars: ✭ 78 (-8.24%)
Mutual labels:  npm
Docker Builder
Docker builder builds Docker images from a friendly config file.
Stars: ✭ 81 (-4.71%)
Mutual labels:  build-tool
Node Fast Ratelimit
☔️ Fast and efficient in-memory rate-limit for Node, used to alleviate most common DOS attacks.
Stars: ✭ 84 (-1.18%)
Mutual labels:  npm
Npm Rails
NPM support for Rails with Bundler-like DSL
Stars: ✭ 81 (-4.71%)
Mutual labels:  npm
Projectbuilder
A tool for easy automating and customizing build process for Unity.
Stars: ✭ 80 (-5.88%)
Mutual labels:  build-tool

npm-scripts-info NPM version Build status for master

Display the description of your npm scripts.

Installation

This module is installed via npm:

npm install npm-scripts-info --save

Usage

Using the scripts-info property

Add 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.

Usings scripts prefixed with ?

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.

Custom Reporters

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.

Using the JavaScript API

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' }
  });

Default Descriptions

Some of the npm scripts are standardized. npm-scripts-info provides default descriptions for them, if no custom description specified in scripts-info.

  • info - Display information about the scripts
  • start - Kickstart the application
  • test - Run the tests
  • build - Build the package
  • watch - Watch codebase, trigger build when source code changes
  • cover - Execute test coverage

Preview

preview

License

ISC © Kier Borromeo

Dependencies Dependency status for master

  • chalk: Terminal string styling done right. Much color.
  • meow: CLI app helper
  • unquote: Remove wrapping quotes from a string.

Dev Dependencies devDependency status for master

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework
  • mock-fs: A configurable mock file system. You know, for testing.
  • mos: A pluggable module that injects content into your markdown files via hidden JavaScript snippets
  • read-pkg-up: Read the closest package.json file
  • rewire: Easy dependency injection for node.js unit testing
  • sinon: JavaScript test spies, stubs and mocks.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].