npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@das.laboratory/nps-i

v2.2.2

Published

Interactive mode for nps

Downloads

9

Readme

Interactive mode for nps

Differences From Original Package

  • If you use an .npmrs or .npmrs.json file, it will load the nps config from there.
  • You can now use scripts that require user input.
  • Adding hiddenFromInteractive: true hides a script from the menu
  • Adding pageSize: <number> sets the number of options shown without scrolling
  • Grouped scripts are divided by a separator
  • Scripts without description don't show 'undefined' anymore
  • In ESM workspaces you can rename package-scripts file to package-scripts.cjs (see below).

Install

npm install -D @das.laboratory/nps-i

or install it globally

npm install -g @das.laboratory/nps-i

ESM projects

If your workspace is set up as module (i.e. the nearest parent package.json contains "type": "module"), node will give you an ERR_REQUIRE_ESM error. This means that it refuses to require your package-scripts.js file because it assumes that all .js files are ESM modules.

In this case simply rename package-scripts.js to package-scripts.cjs (note the .cjs file extension). This will tell node that the file is to be treated as a CommonJS module.

Simple example

package-scripts.js:
See examples/simple/package-scripts.js.

? How can I help you today?

 (Use arrow keys or type to search)
❯ server.start        Start the server
  server.restart      Restart the server
  server.stop         Stop the server
  ──────────────
  db.commit           Diffs the local database with current migrations
(Move up and down to reveal more choices)

Fancy example

package-scripts.js:
See examples/fancy/package-scripts.js.

Output:

 **************************
 ** SERVER SCRIPTS 3000™ **
 **************************

 Choose wisely...

 (Use arrow keys or type to search)
❯ server.start                  Start the server and insert dummy files into the buckets
  server.restart                Restart the server and insert dummy files into the buckets
  server.stop                   Stop the server
  ──────────────
  backup-db.full.local          Full backup of the local database
  backup-db.full.server1        Full backup of the database on server 1
  backup-db.full.server2        Full backup of the database on server 2
  backup-db.full.all            Full backup of all databases
  ──────────────
  backup-db.schema.local        Schema backup of the local database
  backup-db.schema.server1      Schema backup of the database on server 1
  backup-db.schema.server2      Schema backup of the database on server 2
  backup-db.schema.all          Schema backup of all databases
  ──────────────
  backup-db.data.local          Data backup of the local database
  backup-db.data.server1        Data backup of the database on server 1
  backup-db.data.server2        Data backup of the database on server 2
  backup-db.data.all            Data backup of all databases
  ──────────────
  backup-db.split.local         Separate schema & data backup of the local database
(Move up and down to reveal more choices)

Original Authors

See the following for more:

Also includes updates / inspiration from:

Original README

license

MIT © siddharthkp

 

install

npm install nps-i

or install it globally

npm install -g nps-i

 

usage

Replace nps with nps-i in your package.json

{
	"scripts": {
		"start": "nps-i"
	}
}

You can also use it with the shorthand ni when installed globally.

 

like it?

:star: this repo

 

license

MIT © siddharthkp