Comparing version 0.0.3 to 0.0.4
export function generateMermaid( | ||
graph: string, | ||
graph: Record<string, string[]>, | ||
outDir?: string, | ||
@@ -4,0 +4,0 @@ options?: { orientation: string } |
12
index.js
@@ -18,3 +18,3 @@ import * as fs from "node:fs/promises"; | ||
safeGeneration(async () => { | ||
const location = path.join(outDir, `mermaid-${Date.now()}.mmd`); | ||
const location = path.join(outDir, `graph-${Date.now()}.mmd`); | ||
await fs.writeFile(location, mermaid); | ||
@@ -27,3 +27,3 @@ }); | ||
safeGeneration(async () => { | ||
const location = path.join(outDir, `mermaid-${Date.now()}.md`); | ||
const location = path.join(outDir, `graph-${Date.now()}.md`); | ||
await fs.writeFile(location, "```mermaid\n".concat(mermaid, "\n```")); | ||
@@ -36,6 +36,6 @@ }); | ||
safeGeneration(async () => { | ||
const location = path.join(os.tmpdir(), `mermaid-${Date.now()}.mmd`); | ||
const location = path.join(os.tmpdir(), `graph-${Date.now()}.mmd`); | ||
await fs.writeFile(location, mermaid); | ||
await run(location, path.join(outDir, `mermaid-${Date.now()}.svg`)); | ||
await run(location, path.join(outDir, `graph-${Date.now()}.svg`)); | ||
}); | ||
@@ -47,6 +47,6 @@ } | ||
safeGeneration(async () => { | ||
const location = path.join(os.tmpdir(), `mermaid-${Date.now()}.mmd`); | ||
const location = path.join(os.tmpdir(), `graph-${Date.now()}.mmd`); | ||
await fs.writeFile(location, mermaid); | ||
await run(location, path.join(outDir, `mermaid-${Date.now()}.png`)); | ||
await run(location, path.join(outDir, `graph-${Date.now()}.png`)); | ||
}); | ||
@@ -53,0 +53,0 @@ } |
{ | ||
"name": "ligie", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Ligie generates mermaid-js diagrams from Directed Graphs", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
4518