{"name":"@ts-graphviz/adapter","version":"2.0.2","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.1"},"devDependencies":{"@types/node":"^20.11.24","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 "},"_id":"@ts-graphviz/adapter@2.0.2","_integrity":"sha512-zSGszRZAK2ATObOd7MeF3qvF91HMRxGQaQuuyTYexkDt5p9nkXbt/4CBByoF4elF+/ol2Ge1oUEs+uPtD8X9aA==","_resolved":"/tmp/81cd5616c0ead428a6b63dfeded7b983/ts-graphviz-adapter-2.0.2.tgz","_from":"file:ts-graphviz-adapter-2.0.2.tgz","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-zSGszRZAK2ATObOd7MeF3qvF91HMRxGQaQuuyTYexkDt5p9nkXbt/4CBByoF4elF+/ol2Ge1oUEs+uPtD8X9aA==","shasum":"1a2041ad4bf02f4d1cdabba112fad60a89b8d0dc","tarball":"http://registry-npm.ywwl.com/@ts-graphviz/adapter/download/@ts-graphviz/adapter-2.0.2.tgz","fileCount":20,"unpackedSize":26760,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ts-graphviz%2fadapter@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCk3mNKn0AC4FNKdjJAm87Ll3OKYRLnwiD8liMmMQk9wIgAdruWDG7aweXu3WHfLG5q7xb2SGz5eOdQjhJ6/p5o8w="}],"size":7333,"noattachment":false,"key":"/@ts-graphviz/adapter/-/@ts-graphviz/adapter-2.0.2.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.2_1712199859014_0.5415789394767003"},"_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":1712199859194,"_cnpm_publish_time":1712199859194,"dist-tags":{"develop":"0.0.0-pr956-20240225163634","latest":"3.0.12","next":"3.0.13-next-2f003a558829804c90b3ba0727ed647d754e9348"}}