using both nodejs & deno
I have to turn in my class assignments in nodejs.
I am happier with deno.
Is there a standard way to write code so that the same code base can be used both ways?
My naive though would to hide the differences behind maps.
Is there a better way to accomplish this?
6 Replies
Check out dnt
GitHub
GitHub - denoland/dnt: Deno to npm package build tool.
Deno to npm package build tool. Contribute to denoland/dnt development by creating an account on GitHub.
Thank you for the idea.
It's a very different approach; not sure whether or not it is practical for my classwork.
// Much appreciated
@dan.the.discloser Yeah, you should be able to use import maps.
Just remap bare specifiers in Node to
npm:
specifiers in Deno using an import mapUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
I am not sure.
Teacher will check out the assignment from GitHub, try to run it in their nodejs environment and insert comments or maybe other changes into the source code.
I will do a checkout to see them.
So, I figure I can lots of extra files that they can ignore, but I don't want to be having to change / change-back or having separate versions of files.