{"analyzedAt":"2022-12-12T20:38:43.393Z","collected":{"metadata":{"name":"graphviz-cli","scope":"unscoped","version":"2.0.0","description":"Command-line tool for generating graph images from Graphviz source scripts.","keywords":["graphviz","graph","dot"],"date":"2022-12-11T01:26:10.516Z","author":{"name":"Ferdinand Prantl","email":"prantlf@gmail.com","url":"http://prantlf.tk/","username":"prantlf"},"publisher":{"username":"prantlf","email":"prantlf@gmail.com"},"maintainers":[{"username":"prantlf","email":"prantlf@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/prantlf/graphviz-cli.git"},"links":{"npm":"https://www.npmjs.com/package/graphviz-cli","homepage":"https://github.com/prantlf/graphviz-cli#readme","repository":"https://github.com/prantlf/graphviz-cli","bugs":"https://github.com/prantlf/graphviz-cli/issues"},"license":"MIT","dependencies":{"@aduh95/viz.js":"3.7.0"},"devDependencies":{"@semantic-release/changelog":"6.0.2","@semantic-release/git":"10.0.1","@types/node":"18.11.13","c8":"7.12.0","canvas":"2.10.2","denolint":"2.0.5","graphviz-cli":"link:","rollup":"3.7.2","rollup-plugin-cleanup":"3.2.1","rollup-plugin-re":"1.0.7","tehanu":"1.0.1","tehanu-repo-coco":"1.0.0","tehanu-teru":"1.0.0","typescript":"4.9.4"},"releases":[{"from":"2022-11-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":2},{"from":"2022-09-13T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":2},{"from":"2022-06-15T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":2},{"from":"2021-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":3},{"from":"2020-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":3}],"hasTestScript":true,"hasSelectiveFiles":true,"readme":"# graphviz-cli\n\n[![npm](https://img.shields.io/npm/v/graphviz-cli)](https://www.npmjs.com/package/graphviz-cli#top)\n[![codecov](https://codecov.io/gh/prantlf/graphviz-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/prantlf/graphviz-cli)\n[![codebeat badge](https://codebeat.co/badges/9d85c898-df08-42fb-8ab9-407dc2ce2d22)](https://codebeat.co/projects/github-com-prantlf-graphviz-cli-master)\n![Dependency status](https://img.shields.io/librariesio/release/npm/graphviz-cli)\n\nCommand-line tool and [API] for generating graph images from [Graphviz] source scripts.\n\nFeatures:\n\n* Runs in pure JavaScript. Except for the `png` output.\n* No need to install the native [Graphviz] package.\n* Most output formats of the native [Graphviz] (inluding `svg` and `png`) available.\n* TypeScript type declarations (typings) for the [API].\n* [A lot faster](perf/README.md) then calling `dot` as a separate process.\n\nUses [@aduh95/viz.js] to render [Graphviz] scripts in pure JavaScript by [WASM]. Uses [node-canvas] for the optional `png` output.\n\nRelated tools:\n\n* [graphviz-builder] - generates the source script for [Graphviz] consumable by this tool\n* [graphviz-webcomponent] - WebComponent for web browsers to display graph images from the source scripts in HTML pages on-the-fly\n\n## Synopsis\n\n```\ngraphviz -Tsvg -ohello.svg hello.dot\n```\n\n```js\nimport { renderGraphFromSource } from 'graphviz-cli'\n// Render a string with the graph script to a string with the SVG output.\nconst svg = await renderGraphFromSource({ input: 'graph G { ... }' }, { format: 'svg' })\n// Render a file with a graph script to a file with the PNG output.\nawait renderGraphFromSource({ name: 'hello.dot' }, { format: 'png', name: 'hello.png' })\n```\n\n## Installation\n\nMake sure that you have installed [Node.js] 14.8 or newer.\n\nIf you want to use the command-line tool, install this package globally using your favourite package manager ([NPM], [Yarn] or [PNPM]):\n\n```\nnpm i -g graphviz-cli\nyarn global add graphviz-cli\npnpm i -g graphviz-cli\n```\n\nIf you want to use this package programmatically, install it locally using your favourite package manager. Add `-D` on the command line if you need the tool only to build you package:\n\n```\nnpm i graphviz-cli\nyarn add graphviz-cli\npnpm i graphviz-cli\n```\n\nIf you want to render graphs to `png`, install the [node-canvas] module in addition. Add `-g/global` or `-D` arguments according to you choice above:\n\n```\nnpm i canvas\nyarn add canvas\npnpm i canvas\n```\n\nStarting from the version 2.0.0, [node-canvas] is not a peer dependency any more, because NPM installs the peer dependencies automatically, making them not optional any more.\n\n## Command-line\n\nCommand-line parameters are the same as for the `dot` tool from the [Graphviz] package, as long as they are implemented, of course.\n\n```\n$ graphviz -?\n\nGenerates graph images from Graphviz source scripts.\n\nUsage: graphviz [-Vvy?] [-(KTon)<value>] <dot files>\n\nOptions:\n  -Tv           - set output format to 'v'\n  -Kv           - set layout engine to 'v' (overrides source script)\n  -ofile        - write output to 'file'\n  -O            - automatically generate an output filename based on the input\n                  filename with a .'format' appended. (Causes all -ofile\n                  options to be ignored.)\n  -y            - invert y coordinate in output\n  -n[v]         - no layout mode 'v' (=1)\n  -v            - enable verbose mode\n  -V            - print version and exit\n  -?            - print usage and exit\n\nExamples:\n  graphviz -Tsvg -O diagrams/*.dot\n  graphviz -Tpng -Kneato -odiagram.png diagram.dot\n```\n\n## API\n\n### renderGraphFromSource(source: object, options: object): Promise\\<string | Buffer\\>\n\nRenders a graph script to a specified output. If the output format is binary (`png`, for example), the Promise will contain `Buffer` instead of `string`.\n\n```js\nimport { renderGraphFromSource } from 'graphviz-cli'\n// Render a string with the graph script to a string with the SVG output.\nconst svg = await renderGraphFromSource({ input: 'graph G { ... }' }, { format: 'svg' })\n// Render a file with a graph script to a file with the PNG output.\nawait renderGraphFromSource({ name: 'hello.dot' }, { format: 'png', name: 'hello.png' })\n```\n\nSource properties:\n\n|  name   |  type    | description                     |\n|---------|----------|---------------------------------|\n| `name`  | `string` | file name with the graph script |\n| `input` | `string` | graph script                    |\n\nIf neither `name` nor `input` are provided, or the whole `source` parameter is omitted, the graph script will be read from the standard input.\n\nAvailable options:\n\n|  name     |  type     | description                                 |\n|-----------|-----------|---------------------------------------------|\n| `name`    | `string`  | file name for the generated graph output    |\n| `engine`  | `string`  | type of the layout to use for the graph rendering (`circo`, `dot`, `fdp`, `neato`, `osage`, `twopi`, default is `dot`)                   |\n| `format`  | `string`  | type of the output for the rendered graph (`svg`, `png`, `dot`, `xdot`, `plain`, `plain-ext`, `ps`, `ps2`, `json`, `json0`, `canon`, default is `dot`) |\n| `yInvert` | `boolean` | invert the y-coordinate in the graph output |\n| `nop`     | `number`  | no layout mode 'v' (`0` or `1`)             |\n\nIf `name` is not provided the output will be available only in the Promise. If the format `png` is specified, the NPM module [node-canvas] has to be installed, which is required as a peer-dependency of this package.\n\n### engines\n\nList of available graph layout engines: `circo`, `dot`, `fdp`, `neato`, `osage`, `twopi`.\n\n### formats\n\nList of available graph outout formats: `svg`, `png`, `dot`, `xdot`, `plain`, `plain-ext`, `ps`, `ps2`, `json`, `json0`, `canon`.\n\n## License\n\nCopyright (c) 2020-2022 Ferdinand Prantl\n\nLicensed under the MIT license.\n\n[Graphviz]: https://graphviz.org/\n[WASM]: https://developer.mozilla.org/en-US/docs/WebAssembly\n[@aduh95/viz.js]: https://github.com/aduh95/viz.js#readme\n[node-canvas]: https://github.com/Automattic/node-canvas#readme\n[graphviz-builder]: https://github.com/prantlf/graphviz-builder#readme\n[graphviz-webcomponent]: https://github.com/prantlf/graphviz-webcomponent#readme\n[Node.js]: https://nodejs.org/\n[NPM]: https://docs.npmjs.com/cli/npm\n[Yarn]: https://classic.yarnpkg.com/docs/cli/\n[PNPM]: https://pnpm.js.org/pnpm-cli\n[API]: #api"},"npm":{"downloads":[{"from":"2022-12-11T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":89},{"from":"2022-12-05T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":2157},{"from":"2022-11-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":6361},{"from":"2022-09-13T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":24352},{"from":"2022-06-15T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":55910},{"from":"2021-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":106017}],"starsCount":0},"github":{"starsCount":11,"forksCount":0,"subscribersCount":1,"issues":{"count":1,"openCount":1,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":1,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"prantlf","commitsCount":16},{"username":"semantic-release-bot","commitsCount":1}],"commits":[{"from":"2022-12-05T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":0},{"from":"2022-11-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":0},{"from":"2022-09-13T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":0},{"from":"2022-06-15T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":0},{"from":"2021-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":6434,"testsSize":34682,"hasChangelog":true},"linters":["editorconfig"],"coverage":1}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.75,"health":1,"branding":0},"popularity":{"communityInterest":14,"downloadsCount":8117.333333333333,"downloadsAcceleration":-14.567656012176563,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6491791191029508,"detail":{"quality":0.8999999999999999,"popularity":0.08348807776504796,"maintenance":0.9998808339576686}}}