ts-graphviz 1.3.3-dev.dc36620d2 → 1.3.4-dev.584eb2ac9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/adapter/deno/mod.js +13 -1
- package/lib/ast/index.cjs +1 -1
- package/lib/ast/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -534,6 +534,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
534
534
|
<td align="center"><a href="https://github.com/ChristianMurphy"><img src="https://avatars.githubusercontent.com/u/3107513?v=4?s=100" width="100px;" alt="Christian Murphy"/><br /><sub><b>Christian Murphy</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Code">💻</a> <a href="#ideas-ChristianMurphy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Documentation">📖</a></td>
|
|
535
535
|
<td align="center"><a href="https://github.com/ArtemAdamenko"><img src="https://avatars.githubusercontent.com/u/2178516?v=4?s=100" width="100px;" alt="Artem"/><br /><sub><b>Artem</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3AArtemAdamenko" title="Bug reports">🐛</a></td>
|
|
536
536
|
<td align="center"><a href="https://github.com/fredericohpandolfo"><img src="https://avatars.githubusercontent.com/u/24229136?v=4?s=100" width="100px;" alt="fredericohpandolfo"/><br /><sub><b>fredericohpandolfo</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Afredericohpandolfo" title="Bug reports">🐛</a></td>
|
|
537
|
+
<td align="center"><a href="https://github.com/diegoquinteiro"><img src="https://avatars.githubusercontent.com/u/1878108?v=4?s=100" width="100px;" alt="diegoquinteiro"/><br /><sub><b>diegoquinteiro</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Adiegoquinteiro" title="Bug reports">🐛</a></td>
|
|
537
538
|
</tr>
|
|
538
539
|
</tbody>
|
|
539
540
|
</table>
|
package/lib/adapter/deno/mod.js
CHANGED
|
@@ -16,6 +16,7 @@ export async function toStream(dot, options) {
|
|
|
16
16
|
const cp = new Deno.Command(command, {
|
|
17
17
|
args: args,
|
|
18
18
|
stdin: 'piped',
|
|
19
|
+
stdout: 'piped',
|
|
19
20
|
}).spawn();
|
|
20
21
|
const stdin = cp.stdin.getWriter();
|
|
21
22
|
await stdin.write(new TextEncoder().encode(dot));
|
|
@@ -23,11 +24,22 @@ export async function toStream(dot, options) {
|
|
|
23
24
|
return cp.stdout;
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
function open(path) {
|
|
28
|
+
try {
|
|
29
|
+
return Deno.open(path, { write: true });
|
|
30
|
+
} catch (e) {
|
|
31
|
+
if (e instanceof Deno.errors.NotFound) {
|
|
32
|
+
return Deno.open(path, { createNew: true, write: true });
|
|
33
|
+
}
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
/**
|
|
27
39
|
* Execute the Graphviz dot command and output the results to a file.
|
|
28
40
|
*/
|
|
29
41
|
export async function toFile(dot, path, options) {
|
|
30
|
-
const output = await
|
|
42
|
+
const output = await open(path);
|
|
31
43
|
const stream = await toStream(dot, options);
|
|
32
44
|
await stream.pipeTo(output.writable);
|
|
33
45
|
}
|
package/lib/ast/index.cjs
CHANGED
package/lib/ast/index.js
CHANGED
package/package.json
CHANGED