{"name":"@ts-graphviz/adapter","version":"0.0.0-next-20240316100427","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-20240316100427"},"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 "},"readme":"# @ts-graphviz/adapter\n\n> This module status is ![beta](https://img.shields.io/badge/-beta-orange).\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-20240316100427","_integrity":"sha512-Y8dJs2WfLR7G8sltddlW3neYkjG5CWJ0O6MKGawowY6Qm+rxz7SuhN91wZmNkmzFn5ubn7oMwUVUWWQ7aerZ+w==","_resolved":"/tmp/bb2acaa98d11f0d062e425e5f77b450e/ts-graphviz-adapter-0.0.0-next-20240316100427.tgz","_from":"file:ts-graphviz-adapter-0.0.0-next-20240316100427.tgz","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Y8dJs2WfLR7G8sltddlW3neYkjG5CWJ0O6MKGawowY6Qm+rxz7SuhN91wZmNkmzFn5ubn7oMwUVUWWQ7aerZ+w==","shasum":"ae469feff57a875e7b8526436dea54450256fcb6","tarball":"http://registry-npm.ywwl.com/@ts-graphviz/adapter/download/@ts-graphviz/adapter-0.0.0-next-20240316100427.tgz","fileCount":20,"unpackedSize":44513,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ts-graphviz%2fadapter@0.0.0-next-20240316100427","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFP1WKelSsZlHg5mbp+gzUVJZM12IPfhNnNiULVU8q1vAiAXErL3GFAdSyV8r9AIoJG4Yb4WQpt2lU34IH2ZKYun/w=="}],"size":12535,"noattachment":false,"key":"/@ts-graphviz/adapter/-/@ts-graphviz/adapter-0.0.0-next-20240316100427.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-20240316100427_1710583479138_0.7859101732470561"},"_hasShrinkwrap":false,"publish_time":1710583479384,"_cnpm_publish_time":1710583479384,"dist-tags":{"develop":"0.0.0-pr956-20240225163634","latest":"3.0.12","next":"3.0.13-next-2f003a558829804c90b3ba0727ed647d754e9348"}}