{"id":41738,"library":"plantuml-api","title":"plantuml-api","description":"A minimal JavaScript client for generating PlantUML diagram URLs via the PlantUML web service. Current version 0.0.1 provides a single function geturl() that compresses PlantUML source text and returns a URL pointing to an image (PNG, SVG, ASCII art) hosted on plantuml.com. The library has dependencies on johan/js-deflate and plantuml-encoder for encoding. It is a very early package with limited documentation and no TypeScript types, suitable for quick prototyping but not production-grade.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","plantuml","api"],"install":[{"cmd":"npm install plantuml-api","lang":"bash","label":"npm"},{"cmd":"yarn add plantuml-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add plantuml-api","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for deflate compression of PlantUML source","package":"johan/js-deflate","optional":false},{"reason":"Required for encoding the compressed data into a URL-safe format","package":"plantuml-encoder","optional":false}],"imports":[{"note":"Package exports only via CommonJS require() as of v0.0.1; no ESM support yet.","wrong":"import { geturl } from 'plantuml-api';","symbol":"geturl","correct":"const { geturl } = require('plantuml-api');"}],"quickstart":{"code":"const { geturl } = require('plantuml-api');\n\n// Generate SVG URL for a simple sequence diagram\nconst url = geturl('Bob->Alice : hello', 'svg');\nconsole.log(url);\n// Output: http://www.plantuml.com/plantuml/svg/SyfFqhLppCbCJbMmKiX8pSd91m00\n\n// Generate PNG URL\nconst pngUrl = geturl('@startuml\\nAlice->Bob: hi\\n@enduml', 'png');\nconsole.log(pngUrl);","lang":"javascript","description":"Shows how to require the geturl function, generate an SVG URL for a simple diagram, and generate a PNG URL with full PlantUML syntax."},"warnings":[{"fix":"Manually install dependencies: npm install johan/js-deflate plantuml-encoder","message":"URL generation depends on johan/js-deflate and plantuml-encoder — these dependencies are not automatically installed unless specified in package.json.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use fetch() or axios to retrieve the image after obtaining the URL.","message":"The geturl() function only returns a URL string; it does not fetch or render the diagram. Users must handle HTTP requests themselves.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Add a // @ts-ignore or create a .d.ts file: declare module 'plantuml-api';","message":"No TypeScript type definitions shipped; using with TypeScript requires manual declaration or use of require() in a .ts file.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.0.1':20 'api':3,82 'art':42 'ascii':41 'client':7 'compress':27 'current':18 'depend':49 'diagram':11 'document':66 'earli':62 'encod':55,57 'function':24 'generat':9 'geturl':25 'grade':79 'host':43 'imag':38 'javascript':6,80 'johan/js-deflate':51 'librari':47 'limit':65 'minim':5 'packag':63 'plantuml':2,10,15,28,54,81 'plantuml-api':1 'plantuml-encod':53 'plantuml.com':45 'png':39 'point':35 'product':78 'production-grad':77 'prototyp':74 'provid':21 'quick':73 'return':32 'servic':17 'singl':23 'sourc':29 'suitabl':71 'svg':40 'text':30 'type':70 'typescript':69 'url':12,34 'version':19 'via':13 'web':16","created_at":"2026-06-04T18:53:52.206196+00:00","updated_at":"2026-06-04T18:53:52.206196+00:00","problems":[{"fix":"npm install johan/js-deflate","cause":"Missing npm dependency johan/js-deflate","error":"Cannot find module 'johan/js-deflate'"},{"fix":"Use const { geturl } = require('plantuml-api'); instead of import { geturl } from 'plantuml-api';","cause":"Incorrect import pattern; using ESM import instead of CommonJS require","error":"TypeError: geturl is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"plantuml-api","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devtools"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}