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

diagrams

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diagrams

Generate Flowcharts, Network Sequence, Dot, and Railroad Diagrams

  • 0.8.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-23.08%
Maintainers
1
Weekly downloads
 
Created
Source

Overview

Command line tool for generating a suite of various types of diagrams, each based on intuitive text DSLs.

See below for documentation/examples of the syntax/output for each of the currently supported diagrams type:

  • flowchart
  • network sequence
  • graphviz's dot
  • railroad diagrams

Installation

npm install -g diagrams

Usage

watch

The diagrams CLI provides the watch command that will automatically generate the .svg visualization of each diagram file format it supports. Run the following:

Watches the current directory and generates an .svg file in the same directory as any found file.

diagrams watch

Same as above but also first generates all .svg files before starting watch process

diagrams watch --build

To provide the target directory to watch just pass it as an argument right after the watch command.

diagrams watch somedirectory --build

flowchart

Documentation: Flowchart.js .

To generate flowcharts, run:

diagrams flowchart input.flowchart flowchart.svg
input.flowchartflowchart.svg

st=>start: Start
e=>end
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.google.com
io=>inputoutput: catch something

st->op1->cond cond(yes)->io->e cond(no)->sub1(right)->op1

sequence

Documentation: Network Sequence Diagram Syntax .

To generate Network Sequence Diagrams, run:

diagrams sequence input.sequence sequence.svg
input.sequencesequence.svg

Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!

  

dot

Documentation on the dot file format:

To generate diagrams from Graphviz's .dot file format, run:

diagrams dot input.dot dot.svg
input.dotdot.svg

digraph G {
    main -> parse -> execute;
    main -> init;
    main -> cleanup;
    execute -> make_string;
    execute -> printf
    init -> make_string;
    main -> printf;
    execute -> compare;
}

  

railroad

Documentation see railroad-diagrams's documentation':

  • NOTE: There is no real documentation for the input file syntax (PRs welcome), but the examples should help you figure it out a bit
  • Examples
  • Online Generator

To generate Railroad Diagrams, run:

diagrams railroad input.railroad railroad.svg
input.railroadrailroad.svg

Diagram(
  Optional('+', 'skip'),
    Choice(0,
      NonTerminal('name-start char'),
      NonTerminal('escape')),
      ZeroOrMore(
        Choice(0,
          NonTerminal('name char'),
          NonTerminal('escape'))))

  

Credits

TODOs

It's a work in progress. See TODO.md.

Keywords

FAQs

Package last updated on 03 Jan 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