package.json scripts
July 5, 2026 ยท View on GitHub
๐ฆ This package has moved. It now lives in the markdown-magic-plugins monorepo at
packages/package-scripts. This repository is archived; issues and contributions go to the monorepo.
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.
import path from 'path';
import { markdownMagic } from 'markdown-magic';
import SCRIPTS from './index.js';
const config = {
matchWord: 'AUTO-GENERATED-CONTENT',
transforms: {
SCRIPTS,
},
};
const markdownPath = path.join(import.meta.dirname, 'README.md');
await markdownMagic(markdownPath, config);
Usage in markdown
| Script | Description |
|---|---|
docs | generate docs |
empty | echo "this is just an example" |
format | format code |
prepublishOnly | npm run docs |
test | vitest run |