Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wrhs/diagrams

Package Overview
Dependencies
Maintainers
6
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wrhs/diagrams

Utility tool to generate mermaid diagrams for Warehouse.ai

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
6
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 04 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc