This is the package that allows you make transforming between your plantuml code and encoded text.
This package is ESM only with TypeScript declarations, and compatible with Node.js and Browser environment.
It's a forked project of PlantUML Encoder. For origin project is lack of maintenance and does not support TypeScript.
Install this package first.
npm i plantuml-coder
In your code,
import PlantUmlCoder from 'plantuml-coder';
const puml = 'A -> B: Hello World';
const encoded = PlantUmlCoder.encode(puml);
console.log(encoded);
const decoded = PlantUmlCoder.decode(encoded);
console.log(decoded);
Then it will generate encoded content like
SrJGjLDmibBmICt9oLS8po_AIG40
Then you can view the image in URL
www.plantuml.com/plantuml/png/SrJGjLDmibBmICt9oLS8po_AIG40
It looks like:
MIT © 但为君故