plantuml-encoder-decoder

1.2.5-2 • Public • Published

plantuml-encoder

PlantUML encoder for browsers and Node.js.

npm Version build-status js-standard-style

Encoded PlantUML can be used to create PlantUML URL links.

Includes patch to add decode() function. https://github.com/markushedvall/plantuml-encoder/pull/6

Install

Node.js:

npm install plantuml-encoder

browser:

bower install plantuml-encoder

Example

var plantumlEncoder = require('plantuml-encoder')
 
var encoded = plantumlEncoder.encode('A -> B: Hello')
console.log(encoded) // SrJGjLDmibBmICt9oGS0
 
var url = 'http://www.plantuml.com/plantuml/img/' + encoded
 
var decoded = plantumlEncoder.decode(encoded)
console.log(decoded)

The URL can then be used to display the diagram:

alt tag

Decode example

var plantumlEncoder = require('plantuml-encoder')
 
var plain = plantumlEncoder.decode('UDfpLD2rKt2oKl18pSd91m0KGWDz')
console.log(plain) // A -> B: Hello
 

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i plantuml-encoder-decoder

Weekly Downloads

70

Version

1.2.5-2

License

MIT

Unpacked Size

9.74 kB

Total Files

10

Last publish

Collaborators

  • alangibson