Closed ckrauterlovescoffee closed 3 months ago
@ckrauterlovescoffee you can use parseProject
getMermaidDSL
/ getNomnomlDSL
for now and write it yourself.
I will use the async version of writeFile in the next version
Thanks! Looks like this can be closed now as you've added async.
I am trying to import this package, create a diagram and then mess with that diagram subsequently. When doing so, I get the following error,
The reason I am seeing this error is because here and here, writeFile is being used which is inherently
async
, but it is not beingawaited
in this package (in the "here" links). So, my file,./docs/mermaid.dsl
hasn't been created by the time that I am trying to read it. My jenky work around is to sleep for a few hundred milliseconds before any subsequent read operations.Two obvious paths to fix this would be to convert the write methods to
async
methods and await thewriteFile
calls... (createDiagram() would also need to beasync
) Or switch to writeFileSync so the operation is synchronous.Would you be willing to make this change?