https://github.com/mogeko/plantuml-encoding
A Deno library for encoding PlantUML
https://github.com/mogeko/plantuml-encoding
Last synced: over 1 year ago
JSON representation
A Deno library for encoding PlantUML
- Host: GitHub
- URL: https://github.com/mogeko/plantuml-encoding
- Owner: mogeko
- License: mit
- Created: 2024-09-30T10:30:24.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T10:04:56.000Z (over 1 year ago)
- Last Synced: 2025-03-03T11:22:45.627Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plantuml-encoding
[](https://github.com/mogeko/plantuml-encoding/actions/workflows/test.yaml)
[](https://codecov.io/gh/mogeko/plantuml-encoding)
[](https://jsr.io/@mogeko/plantuml-encoding)
A Deno library for encoding and decoding PlantUML code.
## Installation
```sh
deno add @mogeko/plantuml-encoding
```
For Node.js users:
```sh
npx jsr add @mogeko/plantuml-encoding
```
## Encoding
```ts
import { encode } from "jsr:@mogeko/plantuml-encoding";
const encoded = encode("A -> B: Hello");
console.log(encoded); // SrJGjLDmibBmICt9oGS0
const url = `https://www.plantuml.com/plantuml/svg/${encoded}`;
```
Visit the URL and you will get this flowchart:

## Decoding
```ts
import { decode } from "jsr:@mogeko/plantuml-encoding";
const puml = decode("SrJGjLDmibBmICt9oGS0");
console.log(puml); // A -> B: Hello
```
## LICENSE
The code in this project is released under the [MIT License](./LICENSE).