New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsdoc-mermaid

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdoc-mermaid

A tool to automagically create flowcharts and diagrams in your jsdocs.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4.8K
increased by13.95%
Maintainers
1
Weekly downloads
 
Created
Source

jsdoc-mermaid

A plugin that parses your JSDocs for Mermaid syntax and renders the diagrams and flowcharts described.

Getting Started

Add jsdoc-mermaid to your jsdoc configuration file. That's it!

{
    "plugins": ["jsdoc-mermaid"]
}

Usage

Document a method with an @mermaid tag using JSDoc Syntax, like so:

/**
 * Represents a book.
 * @constructor
 * @param {string} title - The title of the book.
 * @param {string} author - The author of the book.
 *
 * @mermaid
 *   graph TD;
 *     A-->B;
 *     A-->C;
 *     B-->D;
 *     C-->D;
 */
function Book(title, author) {
  /* ... */
}

Generate your JSDocs using the configuration you've specified - for instance:

jsdoc book.js -c conf.json 

When you open that page in JSDoc, you should have a shiny new graph!

jsdoc-mermaid example

Built With

  • Mermaid - Generation of diagram and flowchart from text in a similar manner as markdown
  • Doctrine - JSDoc parser

Versioning

We use SemVer for versioning.

FAQs

Package last updated on 06 Oct 2017

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