npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@brainstack/diagram

v1.0.29

Published

A package for generating URLs for PlantUML diagrams in various formats including image, PNG, SVG, and textual representations. Ideal for embedding or sharing UML diagrams across documentation or web applications.

Downloads

593

Readme

@brainstack/diagram

This package offers a streamlined method to generate URLs for PlantUML diagrams, simplifying the embedding or sharing process of UML diagrams across various formats. Whether you're looking to produce images, PNGs, SVGs, or textual representations of your diagrams, @brainstack/diagram is equipped to meet your needs.

Features

  • Supports generating URLs for PlantUML diagrams in multiple formats: Image, PNG, SVG, TXT.
  • User-friendly, compatible with any PlantUML code.
  • Eliminates the requirement for a local PlantUML server by utilizing the PlantUML web server for diagram generation.
  • Ideal for documentation, educational projects, or any application that benefits from UML diagram visualization.

Installation

npm install @brainstack/diagram

Usage

Start by importing the DiagramModule from the package:

import { DiagramModule } from '@brainstack/diagram';

You can then generate URLs for your PlantUML diagrams as follows:

// Example PlantUML code
const umlCode = `
Alice -> Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob --> Alice: I am good thanks!
`;

// Optionally, configure the base URL if you want to use a custom PlantUML server
DiagramModule.setConfig({
  baseUrl: 'https://custom-plantuml-server.com',
});

// Generate and log URL for an image
console.log(DiagramModule.generate_img(umlCode));

// Generate and log URL for a PNG
console.log(DiagramModule.generate_png(umlCode));

// Generate and log URL for an SVG
console.log(DiagramModule.generate_svg(umlCode));

// Generate and log URL for a textual representation
console.log(DiagramModule.generate_txt(umlCode));

Configuration

The setConfig method allows you to customize the configuration, such as changing the base URL of the PlantUML server.

// Change the base URL of the PlantUML server
DiagramModule.setConfig({ baseUrl: 'https://custom-plantuml-server.com' });

This is particularly useful if you prefer to use a specific version of the PlantUML server or require a server within your network for privacy reasons.

Documentation

For a more comprehensive guide on utilizing @brainstack/diagram, please consult the package documentation.

Contributing

We welcome contributions to @brainstack/diagram! For contribution guidelines, please refer to our contributing guidelines.

License

@brainstack/diagram is licensed under the MIT License.

Author

Martin Ouimet - [email protected]


© 2024 Martin Ouimet. All rights reserved.