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
AapoAlas
AapoAlas2y ago
Check out dnt
AapoAlas
AapoAlas2y ago
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.
dan.the.discloser
Thank you for the idea. It's a very different approach; not sure whether or not it is practical for my classwork. // Much appreciated
lcasdev
lcasdev2y ago
@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 map
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dan.the.discloser
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.