{"name":"@ts-graphviz/adapter","version":"0.0.0-next-20240427032031","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":"^0.0.0-next-20240427032031"},"devDependencies":{"@types/node":"^20.12.7","typescript":"^5.3.3","vite":"^5.2.8","vite-plugin-dts":"^3.7.3"},"engines":{"node":">=18"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"vite build && rm ./lib/deno.cjs "},"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","readmeFilename":"README.md","_id":"@ts-graphviz/adapter@0.0.0-next-20240427032031","_integrity":"sha512-MzlJD/lwYr51HWeB4Q9CcN12/jlNGBf+Rd2fetImWkkVpkCjpYJhqjb1vdXIY1kU1q2EwRL++E8d6BbB2Vo2lQ==","_resolved":"/tmp/30f389bab7894262490de33256e86c73/ts-graphviz-adapter-0.0.0-next-20240427032031.tgz","_from":"file:ts-graphviz-adapter-0.0.0-next-20240427032031.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-MzlJD/lwYr51HWeB4Q9CcN12/jlNGBf+Rd2fetImWkkVpkCjpYJhqjb1vdXIY1kU1q2EwRL++E8d6BbB2Vo2lQ==","shasum":"a43e18d2bb0e11df02104bfcd9728bdb8b639e81","tarball":"http://registry-npm.ywwl.com/@ts-graphviz/adapter/download/@ts-graphviz/adapter-0.0.0-next-20240427032031.tgz","fileCount":20,"unpackedSize":28048,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ts-graphviz%2fadapter@0.0.0-next-20240427032031","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu2aPX+zRUvU+m/D0rPWCehLP2DOaP3w+cvqlD+b9GUAiApqgIPIyhc8yHWYV9cBrtVWXUU+FaY3cknYMos3PjWfw=="}],"size":7562,"noattachment":false,"key":"/@ts-graphviz/adapter/-/@ts-graphviz/adapter-0.0.0-next-20240427032031.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_0.0.0-next-20240427032031_1714188042141_0.647695825306412"},"_hasShrinkwrap":false,"publish_time":1714188042296,"_cnpm_publish_time":1714188042296,"dist-tags":{"develop":"0.0.0-pr956-20240225163634","latest":"3.0.12","next":"3.0.13-next-2f003a558829804c90b3ba0727ed647d754e9348"}}