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

diagram-codes-engine-client

v1.0.14

Published

This repository contains the client library for embedding the Diagram Codes Engine into a Web Application.

Downloads

48

Readme

Diagram Codes Engine Client Integration Library

This repository contains the client library for embedding the Diagram Codes Engine into a Web Application.

An active integration subscription is required for using this library in production.

Install

yarn add diagram-codes-engine-client

Usage

Import the module:

import diagramEngine from 'diagram-codes-engine-client'

Then, set the path to the engine. This is provided to you when registering for an integration subscription.

For test purposes you can use this path: https://web-engine-demo-dev.diagram.codes/apirender/

With an active integration subscription you will receive a custom URL for the render-engine (or the web assets to deploy it on any hosting).

//Use your unique engine url.
diagramEngine.setEnginePath('https://web-engine-demo-dev.diagram.codes/apirender/')
let diagramParams = {
    container:'#container',
    type:'mind-map',
    code:`
        "My Map"->b,c,d,e,random
        random->${Math.random()*1000}
    `
}

DiagramEngine.renderDiagram(diagramParams)

screenshot

The previous code will initialize the container and will render the provided diagram (in this case a mind map).

Setting themes

Appearance can be modified to better fit with the host application styles.

let diagramParams = {
    container:'#container',
    type:'mind-map',
    code:'a->b,c,d,e',
    theme: {
        document: {
            backgroundColor: "#fff",
            shadowColor: "black",
            shadow: false,
        },
        nodes: {
            fontFamily: "Arial",
            fontSize: "16",
            textColor:'black',
            fillColor: "white",
            borderWidth: "2",
            borderColor: "black",
            borderRadius: 3,
            padding: 8,
        },
        labels: {
            fontFamily: "Arial",
            fontSize: "14",
            textColor:'black',
            fillColor: "white",
            borderWidth: "0",
            borderColor: "none",
            borderRadius: 0,
            padding: 4,
        },
        connectors: {
            color: "black",
            width: "2",
        }
    }
}

Events

Capture errors

Add a global error handler:

    DiagramEngine.setErrorHandler((errorData)=>{
        console.log(errorData.message);
        console.log(errorData.line);
    })