question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mermaid without browser

See original GitHub issue

I want to do it in pure node.js:

var mermaidAPI = require('mermaid').mermaidAPI;
var graphDefinition = 'graph TB\na-->b';
var graph = mermaidAPI.render(graphDefinition);
console.log(graph);

Currently it is not possible: https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js#L486

if (typeof document === ‘undefined’) { // Todo handle rendering serverside using phantomjs }

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

2reactions
populcommented, Oct 25, 2016

It’s not about the issue, but i made a webpack loader that helps to generate PNG files from mermaid diagrams. https://github.com/popul/mermaid-loader

It can help 😃

0reactions
KartikSonejicommented, Aug 2, 2022

Hi, can this issue be reopened? Puppeteer too launches a headless chrome instance in the background.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mermaid without browser · Issue #260
I want to do it in pure node.js: var mermaidAPI = require('mermaid').mermaidAPI; var graphDefinition = 'graph TB\na-->b'; ...
Read more >
Mermaid Live Editor: Online FlowChart & Diagrams Editor
Simplify documentation and avoid heavy tools. Open source Visio Alternative. Commonly used for explaining your code! Mermaid is a simple markdown-like ...
Read more >
Mermaid | Diagramming and charting tool
JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically.
Read more >
Rendering Mermaid Charts - Markdown Monster Documentation
Refresh the Browser (f5 or Refresh Browser from context Menu); Activate another tab then back to the tab with Mermaid; Enable the ...
Read more >
Building C4 Diagrams in Mermaid
No need for a separate rendering service, all done in browser. Drawbacks: Inflexibility in the styling and layout of Mermaid generated diagrams ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found