# json-to-dot

> Convert a json graph to the dot format

Latest version **1.1.0** (published 2018-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-to-dot
pnpm add json-to-dot
yarn add json-to-dot
bun add json-to-dot
```

Provides the command `json-to-dot`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-10-23 |
| First published | 2018-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Risto Stevcev |
| Maintainers | ristostevcev |
| Keywords | json, dot, graphviz, digraph, graph |

## Links

- npm: https://www.npmjs.com/package/json-to-dot
- Repository: https://github.com/Risto-Stevcev/json-to-dot
- Homepage: https://github.com/Risto-Stevcev/json-to-dot#readme
- Issues: https://github.com/Risto-Stevcev/json-to-dot/issues
- npm.io page: https://npm.io/package/json-to-dot

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-10-23
- 1.0.1 — 2018-10-23
- 1.0.0 — 2018-10-23

## README

# json-to-dot

Convert a json graph to the dot format

## Installation

```sh
$ npm install --save json-to-dot
```

## Usage

It takes a single level json tree with the keys being nodes and the values being 
an array of strings of dependencies that should be connected:

```js
const jsonToDot = require('json-to-dot')

jsonToDot({
  foo: ['bar', 'buzz'],
  bar: ['foo'],
  norf: ['worble', 'buzz'],
  worf: ['worble'],
  fizz: ['buzz']
})
```

You can also pipe a json file directly into it:

```sh
$ npm install -g json-to-dot
$ echo "{\"foo\": [\"bar\", \"baz\"], \"baz\": [\"norf\"]}" | json-to-dot
```

## Converting dot into an image

You can convert the graph into an actual image using graphviz

```sh
$ dot -Tpng graph.dot -o graph.png
```

## License

See LICENSE

---
_Source: https://npm.io/package/json-to-dot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
