Generate install command for npm packages
Add install command to markdown files via markdown-magic
npm install -D markdown-magic-install-command "markdown-magic@>=0.1 <=2.x"
See example.js
for usage.
const fs = require('fs');
const path = require('path');
const markdownMagic = require('markdown-magic');
const config = {
transforms: {
INSTALLCMD: require('./index.js'),
}
}
const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);
npm install --save-dev [email protected] "markdown-magic@>=0.1 <=2.x"
yarn.lock
found) - specify the client for the install command["--save"]
by default) - any flags to be included (like -g
)true
by default) - include peer dependencies in install commandpackage.json
by default) - package.json
path (relative to the Markdown file)false
by default) - add the exact version to the install command