Introduce seq-cli

Apr 8, 2019

I like the sequence tool bramp/js-sequence-diagrams which convert code to pretty diagrams.

However the js-sequence-diagrams only works on browser, so I wrapped it with puppeteer as a command-line tool: seq-cli.

The idea is simple:

  1. Read seq code from file
  2. Render seq code to html file with mustache
  3. Load html file in puppeteer
  4. Render seq code to svg with js-sequence-diagrams in puppeteer
  5. Save svg to file

That's it.

You can install seq-cli from npm and try it:

$ npm install seq-cli
$ cat <<EOF >hello.seq
A -> B: Hey!
Note Over A: this is a note
C -> D: How are you
D --> E: Good day
E ->> F: HAHA
EOF
$ seq-cli -i hello.seq