Install command plugin
July 5, 2026 ยท View on GitHub
๐ฆ This package has moved. It now lives in the markdown-magic-plugins monorepo at
packages/install-command. This repository is archived; issues and contributions go to the monorepo.
Install command plugin
Add install command to markdown files via markdown-magic
Install
npm add -D markdown-magic-install-command markdown-magic@^4
Adding the plugin
See example.js for usage.
import path from 'path';
import { markdownMagic } from 'markdown-magic';
import INSTALLCMD from './index.js';
const config = {
matchWord: 'AUTO-GENERATED-CONTENT',
transforms: {
INSTALLCMD,
},
};
const markdownPath = path.join(import.meta.dirname, 'README.md');
await markdownMagic(markdownPath, config);
Usage in markdown
npm add --save-dev markdown-magic-install-command@3.0.0 markdown-magic@^4
Options
- client (defaults to 'npm' unless
bun.lock,bun.lockb,pnpm-lock.yaml, oryarn.lockfound) - specify the client for the install command - flags (
["--save"]by default) - any flags to be included (like-g) - peers (
trueby default) - include peer dependencies in install command - pkg (closest
package.jsonby default) -package.jsonpath (relative to the Markdown file) - exact (
falseby default) - add the exact version to the install command