Running this via Node v10 will fail with the following error:
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
This is because fs.writeFile now throws an error if a callback isn't provided, it is no longer optional. In Node v8 it was marked as deprecated so running this tool is v8 worked, but it would print out deprecation warnings.
I've changed the call to fs.writeFileSync which doesn't need a callback which works in v10. Since the rest of the function in question was already using the synchronous versions of fs functions, it seemed fine to do so with writeFile as well.
Running this via Node v10 will fail with the following error:
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
This is because
fs.writeFile
now throws an error if a callback isn't provided, it is no longer optional. In Node v8 it was marked as deprecated so running this tool is v8 worked, but it would print out deprecation warnings.I've changed the call to
fs.writeFileSync
which doesn't need a callback which works in v10. Since the rest of the function in question was already using the synchronous versions offs
functions, it seemed fine to do so withwriteFile
as well.This fixes https://github.com/trodi/blockly-d.ts/issues/8