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

mermaid

Package Overview
Dependencies
Maintainers
2
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mermaid

Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

  • 8.0.0-alpha.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
853K
decreased by-0.06%
Maintainers
2
Weekly downloads
 
Created

What is mermaid?

Mermaid is a JavaScript-based diagramming and charting tool that renders Markdown-inspired text definitions to create and dynamically modify diagrams. It is particularly useful for creating flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, and more.

What are mermaid's main functionalities?

Flowcharts

Mermaid allows you to create flowcharts using a simple syntax. The above code creates a flowchart with decision points and different paths.

```mermaid
flowchart TD
    A[Start] --> B{Is it?}
    B -->|Yes| C[OK]
    B -->|No| D[Not OK]
    C --> E[End]
    D --> E[End]
```

Sequence Diagrams

Sequence diagrams can be created to represent interactions between different participants over time. The code sample shows a simple interaction between Alice and Bob.

```mermaid
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>Bob: Hello Bob, how are you?
    Bob-->>Alice: I am good thanks!
```

Gantt Charts

Mermaid supports Gantt charts for project planning and scheduling. The code sample demonstrates how to define tasks and their durations.

```mermaid
gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    section Section
    A task           :a1, 2023-01-01, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2023-01-12  , 12d
    another task     : 24d
```

Class Diagrams

Class diagrams can be used to represent the structure of a system by showing its classes, attributes, and methods. The code sample shows a simple class diagram with inheritance.

```mermaid
classDiagram
    class Animal
    Animal : +String name
    Animal : +int age
    Animal : +void eat()
    Animal : +void sleep()
    class Dog
    Dog : +String breed
    Dog : +void bark()
    Animal <|-- Dog
```

State Diagrams

State diagrams represent the states of an object and transitions between those states. The code sample shows a simple state diagram with different states and transitions.

```mermaid
stateDiagram-v2
    [*] --> Still
    Still --> [*]
    Still --> Moving
    Moving --> Still
    Moving --> Crash
    Crash --> [*]
```

Other packages similar to mermaid

Keywords

FAQs

Package last updated on 14 Mar 2018

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