# npm-scripts-note

> ### Features

Latest version **0.0.2-beta.1** (published 2022-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-scripts-note
pnpm add npm-scripts-note
yarn add npm-scripts-note
bun add npm-scripts-note
```

Provides the command `nsc`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2-beta.1 |
| Published | 2022-10-08 |
| First published | 2022-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 384.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Xing Yahao |
| Maintainers | keidarcy |

## Links

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

## Recent versions

- 0.0.2-beta.1 (latest) — 2022-10-08
- 0.0.2-beta.0 — 2022-10-02

## README

# NPM Script Comments

### Features

- Provide comment for npm scripts.
- Works well community solution.
- Support monorepo.

In a big `package.json` file, we often have a huge list of `scripts` field. It means everybody likes NPM scripts, it's simple easy, we use it everywhere in local development, in CI test flow, in production build. But the problem is while times goes by, _why it's there?_, _where do we use this script?_ always come to mind.

There is no standard place to document them!
Document somewhere in a random file could always possible, but it's not standard or consistency.

### *`NPM Script Comment` comes to help!*

### Get started

```
npx nsc sync
```

`NPM Script Comment` will scan all `package.json` and add `scriptComment` like below.

```json
{
  "scripts": {
    "build": "tsc"
  },
  "scriptsComment": {
    "build": "Build whole project"
  }
}
```
Recommend add `sync` to git pre-commit hook.

### Work with linter

```
npx nsc sync
```

If `scripts` has more keys more then `scriptsComment` add script key to `scriptsComment`.
If `scriptsComment` has more keys than `scripts`, throw errors to require fix deleted script.
If you don't to stop commit add with `--ignore-` flag.

### See report

```
npx nsc report
```

generate all scripts and script comments from current root directory.





## License

MIT, keidarcy

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