@wrhs/diagrams

1.0.0 • Public • Published

@wrhs/diagrams

Version npm License npm Downloads Dependencies CircleCI

Utility to generate consistent Mermaid diagrams for Warehouse.ai modules.

Install

npm install @wrhs/diagrams --save-dev

Usage

The easiest way to use this tool is by adding an npm command to the consuming module's package.json

"scripts": {
  "diagrams": "wrhs-diagrams --source=./docs/diagrams --target=./docs --theme=forest"
  ...
},

This command can then be used from the consuming module by running

npm run diagrams

API

The tool uses puppeteer with Mermaid's API to generate svg's from the .mmd diagram definitions. canihaz will install Puppeteer the first time this tool is used. It only has a single command, but it supports the following flags.

  • --source: Relative path to directory with .mmd source files, defaults to ./diagrams.
  • --target: Relative path to directory to store .png output files, defaults to ./assets.
  • --file: Relative path to source files --file one.mmd --file two.mmd.
  • --theme: Theme to be used for diagram styling, defaults to forest.

Note: If you need to assert the HTML used in Puppeteer to generate the chart set DEBUG=true to have the script output both an .png and .html file.

Test

npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i @wrhs/diagrams

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

14.2 kB

Total Files

9

Last publish

Collaborators

  • decompil3d
  • jacopodaeli
  • indexzero
  • jcrugzz
  • msluther
  • swaagie
  • wjarvis