A markdown to png image converter
$ npm install mini-md2png
# or yarn
$ yarn add mini-md2png
m2png(filePath,options)
filePath | |
---|---|
type | string |
description | 图片路径 |
filename | width | |
---|---|---|
type | string |
number |
description | 输出图片名称 | 图片宽度 |
const m2png = require('mini-md2png')
await m2png('./bar.md')
await m2png('./bar.md', options)
$ PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors npm i -g mini-md2png
# or yarn
$ yarn global add mini-md2png
$ mini-md2png --help
Usage: mini-md2png <input>
Options:
-V, --version output the version number
-o, --output <output> output filename
-w, --width <width> output image width
-h, --help display help for command
Example:
$ mini-md2png example.md -o output.png -w 800
or use npx
$ npx mini-md2png example.md -o output.png -w 800