Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-ls-scripts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-ls-scripts

List runnable npm scripts in package.json

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
478
increased by11.42%
Maintainers
1
Weekly downloads
 
Created
Source

npm-ls-scripts

List runnable npm scripts

Inspired by rake -T, which will show you all the tasks runnable by rake, this script will show you all the runnable scripts that npm's package.json knows about.

Usage

Npm lets you define scripts that npm can run. Your package.json will include:

{
  "scripts": {
    "start": "node app.js",
    "job": "node my/one-off/job.js"
  }
}

You could cat package.json, but that's lame. Instead, install npm-ls-scripts:

npm install npm-ls-scripts --save

And run:

ls-scripts

And see the scripts in a nice list:

NPM - ls scripts
---
start - node app.js
job   - node my/one-off/job.js
---

Note: ls-scripts is the binary that comes with this package. To use, adjust your path to include:

export PATH=./node_modules/.bin:$PATH

Alternately, after installation, you could type:

node_modules/.bin/ls-scripts

Or different still, you make a script to run npm-ls-scripts in your package.json:

{
  "scripts": {
    "ls": "node_modules/.bin/ls-scripts"
  }
}

And run with:

npm run ls

Config

You can make the output even nice by adding a verbal description to scripts that may be helped by it. Add config via your package.json:

{
  "config": {
    "scripts": {
      "job": "I would gladly do the job"
    }
  },
  "scripts": {
    "start": "node app.js",
    "job": "node my/one-off/job.js"
  }
}

Make sure the script names match between config and scripts.

Run with this config, and you should see:

NPM - ls scripts
---
start - node app.js
job   - I would gladly do the job
---

Note that you do not need to specify a description for all scripts if it's not useful or your fingers are tired.

Keywords

FAQs

Package last updated on 09 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc