fivetran / typescript-closure-tools

62 stars 11 forks source link

Add support for Node v10 #17

Closed trodi closed 6 years ago

trodi commented 6 years ago

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.

This fixes https://github.com/trodi/blockly-d.ts/issues/8

trodi commented 6 years ago

@georgewfraser any chance this could get merged and the updated package published?