{"name":"@ts-graphviz/adapter","version":"2.0.1","description":"Graphviz Runtime adapters for Cross Platform","keywords":["graphviz","dot"],"homepage":"https://github.com/ts-graphviz/ts-graphviz#readme","bugs":{"url":"https://github.com/ts-graphviz/ts-graphviz/issues"},"repository":{"type":"git","url":"git+https://github.com/ts-graphviz/ts-graphviz.git","directory":"packages/adapter"},"funding":[{"type":"github","url":"https://github.com/sponsors/ts-graphviz"},{"type":"opencollective","url":"https://opencollective.com/ts-graphviz"}],"license":"MIT","author":{"name":"Yuki Yamazaki","email":"yuki@kamiazya.tech"},"type":"module","exports":{".":{"browser":{"types":"./lib/browser.d.ts","require":"./lib/browser.cjs","default":"./lib/browser.js"},"deno":{"types":"./lib/deno.d.ts","default":"./lib/deno.js"},"default":{"types":"./lib/node.d.ts","require":"./lib/node.cjs","default":"./lib/node.js"}},"./package.json":"./package.json"},"main":"./lib/node.cjs","module":"./lib/node.js","types":"./lib/node.d.ts","dependencies":{"@ts-graphviz/common":"^2.1.0"},"devDependencies":{"@types/node":"^20.11.24","typescript":"^5.3.3","vite":"^5.1.3","vite-plugin-dts":"^3.7.3"},"engines":{"node":">=18"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"vite build && rm ./lib/deno.cjs "},"_id":"@ts-graphviz/adapter@2.0.1","_integrity":"sha512-35+KvDKLGJVQHh6APMEvoMQ7dWFmASoEIzGg/4oWHQtuEo4UInKpjR++RlAQQX4cr+A/8N5d9qckUMxdrE3nHA==","_resolved":"/tmp/a543ffe8819549b928d249c943b97bbd/ts-graphviz-adapter-2.0.1.tgz","_from":"file:ts-graphviz-adapter-2.0.1.tgz","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-35+KvDKLGJVQHh6APMEvoMQ7dWFmASoEIzGg/4oWHQtuEo4UInKpjR++RlAQQX4cr+A/8N5d9qckUMxdrE3nHA==","shasum":"1834d7b29ea77124402ef1e97e44f964c239f842","tarball":"http://registry-npm.ywwl.com/@ts-graphviz/adapter/download/@ts-graphviz/adapter-2.0.1.tgz","fileCount":20,"unpackedSize":25903,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ts-graphviz%2fadapter@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHskMZFtjTpNL3DylombNJIxOe/SM9AQf7dY2EsJukJHAiBb+vhxlylq3ymp9nRHMMONB0N16YwNrZmYiZpsM76kBQ=="}],"size":7199,"noattachment":false,"key":"/@ts-graphviz/adapter/-/@ts-graphviz/adapter-2.0.1.tgz"},"_npmUser":{"name":"kamiazya","email":"yuki@kamiazya.tech"},"directories":{},"maintainers":[{"name":"kamiazya","email":"yuki@kamiazya.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adapter_2.0.1_1710689027525_0.5427918747543705"},"_hasShrinkwrap":false,"readme":"# @ts-graphviz/adapter\n\n> It is part of the ts-graphviz library, which is split into modular packages to improve maintainability, flexibility, and ease of use.\n\nProvides an interface to run Graphviz dot commands.\n\n[Graphviz](https://graphviz.gitlab.io/) must be installed so that the dot command can be executed.\n\nExecute the dot command to output a DOT language string to a stream or file.\n\n![Adapter State Machine](./media/adapter-state-machine.svg)\n\n## Usage\n\nThis module provides the following functions.\n\n- The `toStream` function converts **DOT** to **Stream**.\n    ```ts\n    import { toStream } from '@ts-graphviz/adapter';\n\n    const dot = `\n      digraph example {\n        node1 [\n          label = \"My Node\",\n        ]\n      }\n    `;\n\n    const stream = await toStream(dot, { format: 'svg' });\n    // Node.js\n    stream.pipe(process.stdout);\n    // Deno\n    await stream.pipeTo(Deno.stdout.writable);\n    ```\n- Writes **DOT** to a file at the specified path `toFile` function\n    ```ts\n    import { toFile } from '@ts-graphviz/adapter';\n\n    const dot = `\n      digraph example {\n        node1 [\n          label = \"My Node\",\n        ]\n      }\n    `;\n\n    await toFile(dot, './result.svg', { format: 'svg' });\n    ```\n\n> **Note** Designed to work with Node.js and Deno, Stream is runtime native.\n\nFor more examples and usage details, please refer to the ts-graphviz documentation.\n\n## Contributing\n\nContributions to the ts-graphviz project are welcome.\n\nPlease refer to the main ts-graphviz repository for guidelines on how to contribute.\n\n## License\n\nThis package is released under the MIT License.\n","publish_time":1710689027699,"_cnpm_publish_time":1710689027699,"dist-tags":{"develop":"0.0.0-pr956-20240225163634","latest":"3.0.12","next":"3.0.13-next-2f003a558829804c90b3ba0727ed647d754e9348"}}