3 ms·
There are some manual things you can do to ensure portability from Node to Deno: * separate out the Node APIs from the rest of your application logic as much a
by austincheney 6y ago
There are some manual things you can do to ensure portability from Node to Deno:
* separate out the Node APIs from the rest of your application logic as much as possible as those will be different unrelated API conventions.
* convert your application from using require to using ES6 modules. This won’t work if you have more that few highly trivial dependencies as Node requires picking one way of importing files and that one way extends to your dependencies as well.
* Node uses callbacks for asynchronous logic where Deno uses promises, so ensure all callback functions are passed by reference so that the difference is an API difference instead of a logic difference.