markdown-magic-install-command
v3.1.0
Published
Print install command for markdown file
Maintainers
Readme
Install command plugin
Add install command to markdown files via markdown-magic
Install
npm add -D markdown-magic-install-command markdown-magic@^4Adding the plugin
See example.ts for usage.
import path from 'path';
import { markdownMagic } from 'markdown-magic';
import INSTALLCMD from './index.ts';
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 [email protected] markdown-magic@^4Options
- 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
