# @das.laboratory/nps-i

> Interactive mode for nps

Latest version **2.2.2** (published 2024-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @das.laboratory/nps-i
pnpm add @das.laboratory/nps-i
yarn add @das.laboratory/nps-i
bun add @das.laboratory/nps-i
```

Provides the commands `ni`, `nps-i`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2024-01-08 |
| First published | 2022-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 16 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | siddharthkp |
| Maintainers | nreibnitz |

## Links

- npm: https://www.npmjs.com/package/@das.laboratory/nps-i
- Repository: https://github.com/NicolasReibnitz/nps-i
- Homepage: https://github.com/NicolasReibnitz/nps-i#readme
- Issues: https://github.com/NicolasReibnitz/nps-i/issues
- npm.io page: https://npm.io/package/@das.laboratory/nps-i

## Dependencies (7)

- [nps](https://npm.io/package/nps.md) 5.10.0
- [execa](https://npm.io/package/execa.md) ^1.0.0
- [fuzzy](https://npm.io/package/fuzzy.md) 0.1.3
- [inquirer](https://npm.io/package/inquirer.md) 8.1.5
- [nps-utils](https://npm.io/package/nps-utils.md) 1.7.0
- [right-pad](https://npm.io/package/right-pad.md) 1.0.1
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) 1.4.0

## Recent versions

- 2.2.2 (latest) — 2024-01-08
- 2.2.1 — 2024-01-08
- 2.2.0 — 2024-01-07
- 2.1.2 — 2022-06-11
- 2.1.1 — 2022-06-11
- 2.1.0 — 2022-06-11

## 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](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](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:

-   [https://github.com/siddharthkp/nps-i](https://github.com/siddharthkp/nps-i)
-   [https://www.npmjs.com/package/nps-i](https://www.npmjs.com/package/nps-i)
-   [https://github.com/sezna/nps](https://github.com/sezna/nps)
-   [https://www.npmjs.com/package/nps](https://www.npmjs.com/package/nps)

Also includes updates / inspiration from:

-   [https://github.com/nstudio/nps-i](https://github.com/nstudio/nps-i)
-   [https://github.com/nickroberts/nps-i](https://github.com/nickroberts/nps-i)
-   [https://github.com/siddharthkp/nps-i/pull/2](https://github.com/siddharthkp/nps-i/pull/2)

## Original README

#### license

MIT © [siddharthkp](https://github.com/siddharthkp)

<p align="center">
  <img src="https://78.media.tumblr.com/240d51485c042ab5bed754294ad020c6/tumblr_msz10zJc751svwlszo2_500.gif" height="200px"/>
  <br><br>
  <b>Interactive mode for <a target="_blank" href="https://github.com/kentcdodds/nps">nps</a></b>
  <br><br>
  Demo:
  <br><br>
  <a target="_blank" href="https://twitter.com/siddharthkp/status/1007325679543816192"><img src="https://user-images.githubusercontent.com/1863771/41420782-e0549988-7012-11e8-93c5-6f87019d08ef.png" height="300px"/></a>
</p>

&nbsp;

#### install

```
npm install nps-i
```

or install it globally

```
npm install -g nps-i
```

&nbsp;

#### usage

Replace `nps` with `nps-i` in your package.json

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

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

&nbsp;

#### like it?

:star: this repo

&nbsp;

#### license

MIT © [siddharthkp](https://github.com/siddharthkp)

---
_Source: https://npm.io/package/@das.laboratory/nps-i · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
