markdown-magic-package-scripts
Version:
Print list of scripts in package.json with descriptions
43 lines (32 loc) • 1.05 kB
Markdown
# `package.json` scripts
Add a table of scripts from `package.json` to markdown files via [markdown-magic](https://github.com/DavidWells/markdown-magic)
## Install
```
yarn add -D markdown-magic markdown-magic-package-scripts
```
## Adding the plugin
See `example.js` for usage.
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./example.js) -->
<!-- The below code snippet is automatically added from ./example.js -->
```js
const fs = require('fs');
const path = require('path');
const markdownMagic = require('markdown-magic');
const config = {
transforms: {
SCRIPTS: require('./index.js'),
},
};
const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);
```
<!-- AUTO-GENERATED-CONTENT:END *-->
## Usage in markdown
<!-- AUTO-GENERATED-CONTENT:START (SCRIPTS) -->
| Script | Description |
|--------|-------------|
| `docs` | generate docs |
| `empty` | `echo "this is just an example"` |
| `format` | format code |
| `prepublish` | npm hook to run before publishing |
<!-- AUTO-GENERATED-CONTENT:END -->