Reputation: 3085
I understand that most of npm packages are not compatible with Deno.js due to using require()
, at least the ones not in deno.land/x.
But is the opposite possible? Can a Deno.js script be used in a Node.js project?
If yes, then how to convert the URL script into a node_modules
package?
Upvotes: 2
Views: 1037
Reputation: 15124
The opposite would have similar constraints.
The only practical way that a script can run on both Deno and Node.js, without pain and without adapting the code, is that if uses plain JavaScript.
Suppose you want to build a portable app to run on both Node.js and Deno:
A system in the real world cannot scale with these restrictions.
Upvotes: 1