# npm-package-user-scripts-list

> List all available npm script commands

Latest version **0.1.10** (published 2018-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-package-user-scripts-list
pnpm add npm-package-user-scripts-list
yarn add npm-package-user-scripts-list
bun add npm-package-user-scripts-list
```

Provides the command `npm-package-user-scripts-list`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2018-11-27 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lilliputten |
| Maintainers | lilliputten |
| Keywords | npm, run, package, scripts |

## Links

- npm: https://www.npmjs.com/package/npm-package-user-scripts-list
- Repository: https://github.com/lilliputten/npm-package-user-scripts-list
- Homepage: https://github.com/lilliputten/npm-package-user-scripts-list#readme
- Issues: https://github.com/lilliputten/npm-package-user-scripts-list/issues
- npm.io page: https://npm.io/package/npm-package-user-scripts-list

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.1.10 (latest) — 2018-11-27
- 0.1.9 — 2018-11-26
- 0.1.8 — 2018-11-26
- 0.1.7 — 2018-11-26
- 0.1.6 — 2018-11-26
- 0.1.5 — 2018-11-26
- 0.1.4 — 2018-11-26
- 0.1.3 — 2018-11-26
- 0.1.2 — 2018-11-26
- 0.1.1 — 2018-11-26
- 0.0.4 — 2018-11-25
- 0.0.3 — 2018-11-25
- 0.0.2 — 2018-11-25
- 0.0.1 — 2018-11-25

## README

[![npm version](https://badge.fury.io/js/npm-package-user-scripts-list.svg)](https://badge.fury.io/js/npm-package-user-scripts-list)

# npm-package-user-scripts-list

List all available npm script commands listed in `scripts` section of
`package.json` located in current (usually project root) folder.

Lists only items preceeded by `echo --<Some description text>-- && <...>`
commands from `scripts` section or any items with `title` property from
`npm-package-user-scripts` section. `npm-package-user-scripts` section also may
contain special *default* item (with id `__default__`, if not redefined in
options parameter; TODO).

Commands with keys ends with `*-UNUSED` or `*-SAMPLE` strings are excluded.

In next example commands `command-SAMPLE`, `command-UNUSED` and
`skipped-command` are ignored, `npm-package-user-scripts-command` uses `echo
Overrided command` (which specified in `npm-package-user-scripts` section) and
all commands has `someCommonParameter` property:

```json
  "npm-package-user-scripts": {
    "__default__": {
      "someCommonParameter": true
    },
    "npm-package-user-scripts-command": {
      "title": "Command from `npm-package-user-scripts` section",
      "cmd": "echo Overrided command"
    }
  },
  "scripts": {
    "skipped-command": "echo Commands without leading `echo --*--` are skipped (if not listed in `npm-package-user-scripts` section -- see next command)",
    "npm-package-user-scripts-command": "echo Commands present in `npm-package-user-scripts` section (with `title` property) are used",
    "command-SAMPLE": "echo --Sample command (not used)--",
    "command-UNUSED": "echo --Unused command (not used)--",
    "lint": "echo --Lint source code-- && eslint . --ext .js && echo --No JS problems found--",
    "test": "echo --Run tests-- && jest",
    "help": "echo --List all available script commands (autotest)-- && node ./cli.js"
  }
```

## Installation

For current project:

```shell
$ npm i -S npm-package-user-scripts-list
```
Or global:
```shell
$ npm i -g npm-package-user-scripts-list
```

## Usage

In javascript code:

```js
const scriptsList = require('npm-package-user-scripts-list');

// Get script commands
const scriptCommands = scriptsList.getScripts();

// Print command names to console
Object.keys(scriptCommands).map((id) => {
  console.log(id, scriptCommands[id].title);
});
```

From shell command line:
```shell
$ npm-package-user-scripts-list
```

Add command shortcut to `package.json`:
```json
  "scripts": {
    "help": "echo --List all available script commands-- && npm-package-user-scripts-list"
  }
```

Sample command line line result:
```shell
$ npm-package-user-scripts-list

Available commands (for npm run -s <cmd>):

  npm-package-user-scripts-command: Command from `npm-package-user-scripts` section
  lint: Lint source code
  test: Run tests
  help: List all available script commands (autotest)
```

## See also

- [Npm launcher](https://github.com/lilliputten/npm-launcher)

<!--
@version 2018.11.27, 20:15
-->

---
_Source: https://npm.io/package/npm-package-user-scripts-list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
