Home

Awesome

package.json scripts

Add a table of scripts from package.json to markdown files via 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 -->
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) -->
ScriptDescription
docsgenerate docs
emptyecho "this is just an example"
formatformat code
prepublishnpm hook to run before publishing
<!-- AUTO-GENERATED-CONTENT:END -->