specpress
Version:
Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files
19 lines (15 loc) • 484 B
JavaScript
import plantuml from "node-plantuml";
import * as fs from "fs";
import { normalize } from "path";
import { getFileNameWithoutExtension } from "../helpers/index.mjs";
export function generateUmlFromTextFile(pathFile, pathFiguresFolder) {
if (pathFile) {
const fileName = getFileNameWithoutExtension(pathFile);
let gen = plantuml.generate(pathFile);
gen.out.pipe(
fs.createWriteStream(
normalize(`${pathFiguresFolder}/${fileName}.png`)
)
);
}
}