ts-graphviz
Advanced tools
Comparing version 1.3.3-dev.dc36620d2 to 1.3.4-dev.c1e4c50a9
@@ -19,2 +19,3 @@ function commandBuilder({ dotCommand = 'dot', suppressWarnings = true, format = 'svg' } = {}) { | ||
stdin: 'piped', | ||
stdout: 'piped', | ||
}).spawn(); | ||
@@ -27,2 +28,13 @@ const stdin = cp.stdin.getWriter(); | ||
function open(path) { | ||
try { | ||
return Deno.open(path, { write: true }); | ||
} catch (e) { | ||
if (e instanceof Deno.errors.NotFound) { | ||
return Deno.open(path, { createNew: true, write: true }); | ||
} | ||
throw e; | ||
} | ||
} | ||
/** | ||
@@ -32,5 +44,5 @@ * Execute the Graphviz dot command and output the results to a file. | ||
export async function toFile(dot, path, options) { | ||
const output = await Deno.open(path, { write: true }); | ||
const output = await open(path); | ||
const stream = await toStream(dot, options); | ||
await stream.pipeTo(output.writable); | ||
} |
{ | ||
"name": "ts-graphviz", | ||
"version": "1.3.3-dev.dc36620d2", | ||
"version": "1.3.4-dev.c1e4c50a9", | ||
"author": "kamiazya <yuki@kamiazya.tech>", | ||
@@ -5,0 +5,0 @@ "description": "Graphviz library for TypeScript.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
559026
18658