New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

terminal-graphs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-graphs

Layouts and prints graphs (DAGs) to the terminal.

latest
npmnpm
Version
1.0.6
Version published
Weekly downloads
15
50%
Maintainers
1
Weekly downloads
 
Created
Source

terminal-graphs

Tool that allows drawing graphs (usually DAGs) in the terminal. It can handle a restricted subset of dot-files (we use graphlib-dot to parse the dot files). And it can work with Klay JSON Graphs..

Installation

Via npm:

npm install terminal-graphs

Usage

This package has a CLI interface and an API.

CLI

You can install the terminal-graphs package globally (npm i -g terminal-graphs). After this you can run it in the terminal via:

terminal-graphs --dot someGraph.dot
cat someGraph.dot | terminal-graphs --dot
terminal-graphs someKlayGraph.json
cat someKlayGraph.json | terminal-graphs

If you do not pass any arguments it will prompt you for an input.

API

The package exports two functions render and renderDot. Both return a Promise that will return the graph as a string.

var termGraphs = require('terminal-graphs')

termGraphs.renderDot('digraph { A -> B }')
.then((res) => console.log(res))

termGraphs.render({...Klay Graph...})
.then((res) => console.log(res))

Output

The output looks like this:

Keywords

graph

FAQs

Package last updated on 20 Dec 2016

Did you know?

Socket

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.

Install

Related posts