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 🙏

© 2026 – Pkg Stats / Ryan Hefner

diagrams-js

v0.1.0

Published

A TypeScript port of the diagrams Python library for drawing cloud system architecture diagrams as code

Readme

diagrams-js

diagrams-js

A (vibe-coded) TypeScript/JavaScript port of the popular Python diagrams library for drawing cloud system architecture diagrams as code.

NPM Version NPM Downloads CI License: MIT

Features

  • Diagram as Code: Define your architecture diagrams in TypeScript
  • 17+ Cloud Providers: AWS, Azure, GCP, Kubernetes, Alibaba Cloud, Oracle Cloud, IBM Cloud, and more
  • 2000+ Node Classes: Comprehensive coverage of cloud services and infrastructure components
  • Cross-Platform: Works in browsers, Node.js, Deno and Bun
  • Multiple Output Formats: SVG, PNG, JPG, and DOT
  • Type-Safe: Full TypeScript support with comprehensive type definitions
  • WebAssembly Powered: Uses a WebAssembly build of Graphviz (viz) for fast, client-side rendering
  • Custom Nodes: Support for external icons and images
  • Tree-Shakable: Import only what you need

Examples

Web Architecture

Check the examples page for a full list of examples.

Interactive Playground

Check out the playground for a live demo of diagrams-js in your browser.

Installation

# npm
npm install diagrams-js

Quick Start

Node.js / TypeScript

import { Diagram } from "diagrams-js";
import { EC2, Lambda } from "diagrams-js/aws/compute";
import { RDS } from "diagrams-js/aws/database";
import { S3 } from "diagrams-js/aws/storage";
import { ALB } from "diagrams-js/aws/network";

const diagram = Diagram("AWS Architecture", { direction: "TB" });

// Create nodes with icons
const lb = diagram.add(ALB("Load Balancer"));
const web = diagram.add(EC2("Web Server"));
const api = diagram.add(Lambda("API"));
const db = diagram.add(RDS("Database"));
const storage = diagram.add(S3("Storage"));

// Connect them
lb.to(web).to(api);
api.to([db, storage]);

// Render to SVG
const svg = await diagram.render();

Browser

<script type="module">
  import { Diagram } from "https://esm.sh/diagrams-js";
  import { EC2 } from "https://esm.sh/diagrams-js/aws/compute";
  import { RDS } from "https://esm.sh/diagrams-js/aws/database";

  const diagram = Diagram("My Diagram");
  const web = diagram.add(EC2("Web Server"));
  const db = diagram.add(RDS("Database"));

  web.to(db);

  const svg = await diagram.render();
  document.body.innerHTML = svg;
</script>

Documentation

📚 Full documentation: https://diagrams-js.hatemhosny.dev

Supported Providers

| Provider | Description | | ------------------------------------------------------------------------- | ---------------------------------------- | | AWS | Amazon Web Services nodes | | Azure | Microsoft Azure nodes | | GCP | Google Cloud Platform nodes | | Kubernetes | Kubernetes nodes | | OnPrem | On-premises infrastructure nodes | | AlibabaCloud | Alibaba Cloud nodes | | DigitalOcean | DigitalOcean nodes | | Elastic | Elastic Stack nodes | | Firebase | Firebase nodes | | Generic | Generic computing nodes | | GIS | GIS nodes | | IBM | IBM Cloud nodes | | OCI | Oracle Cloud Infrastructure nodes | | OpenStack | OpenStack nodes | | Outscale | Outscale nodes | | Programming | Programming language and framework nodes | | SaaS | SaaS application nodes |

View the full list

Development

Prerequisites

  • Node.js 18+
  • pnpm
  • Vite+

Setup

# Clone the repository
git clone https://github.com/hatemhosny/diagrams-js.git
cd diagrams-js

# Install dependencies
vp install

# Run tests
vp test

# Run checks (lint, format, types)
vp check

# Build the library
vp run build

Project Structure

diagrams-js/
├── src/              # Source code
│   ├── index.ts      # Main exports
│   ├── Diagram.ts    # Core diagram class
│   ├── Node.ts       # Base node class
│   ├── Edge.ts       # Edge/connection class
│   ├── Cluster.ts    # Cluster/grouping class
│   └── providers/    # Auto-generated provider classes
├── resources/        # Icon resources (PNG files)
├── scripts/          # Build and generation scripts
├── tests/            # Test files
└── docs/             # Documentation site

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Acknowledgments

This project is a TypeScript port of the excellent Python diagrams library by mingrammer.

Support


License

This project is licensed under the MIT License - see the LICENSE file for details.

Sponsor 💚

Please consider sponsoring the project, to support its ongoing development and maintenance, as well as help to ensure that it remains a valuable resource for the developer community.