
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@ts-graphviz/ast
Advanced tools
It is part of the ts-graphviz library, which is split into modular packages to improve maintainability, flexibility, and ease of use.
This package contains the module for processing the DOT language at the Abstract Syntax Tree (AST) level for the ts-graphviz library.
Import the necessary functions and classes from the @ts-graphviz/ast package:
import { parse, stringify } from '@ts-graphviz/ast';
Use the imported items in your project to work with DOT language ASTs:
const dotString = 'digraph G { A -> B; }';
const ast = parse(dotString);
const outputDotString = stringify(ast);
console.log('Output DOT string:', outputDotString);
For more examples and usage details, please refer to the ts-graphviz documentation.
Contributions to the ts-graphviz project are welcome.
Please refer to the main ts-graphviz repository for guidelines on how to contribute.
This package is released under the MIT License.
Graphlib is a JavaScript library for creating and manipulating directed graphs. It provides a more general-purpose graph manipulation API compared to @ts-graphviz/ast, which is specifically focused on the DOT language.
Viz.js is a library that allows you to render DOT files using Graphviz in the browser. While @ts-graphviz/ast focuses on parsing and generating DOT files, Viz.js is more about rendering them.
d3-graphviz is a library that integrates Graphviz with D3.js for rendering graphs in the browser. It provides higher-level visualization capabilities compared to the AST manipulation provided by @ts-graphviz/ast.
FAQs
Graphviz AST(Abstract Syntax Tree) Utilities
The npm package @ts-graphviz/ast receives a total of 571,006 weekly downloads. As such, @ts-graphviz/ast popularity was classified as popular.
We found that @ts-graphviz/ast demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.

Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.

Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.