📦 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.
Add install command to markdown files via markdown-magic
npm add -D markdown-magic-install-command markdown-magic@^4See 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);npm add --save-dev markdown-magic-install-command@3.0.0 markdown-magic@^4- 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