Can i migrate my Node based project to Deno?

Viewed 3514

Hello I am a frontEnd developer.

First, I don't know much about the runtime environment.
Is it possible to convert my project into Deno with Node?

Even if I change all of my code,
I'm not sure if the libraries I've received can run in a Deno environment.
(too many libs...) (React, Apollo, many many many)

And since the current webpack settings are very complex and difficult to understand, (And I understand very little about the build system.)
I am not sure if this can work in a Deno environment.

In my opinion, it seems impossible, I will only use Deno when working on a new project, Or wait for someone to create a migration guide.

What do you think about this?

Add

Obviously, it would be impossible if the libraries I used were not registered in the Deno repository.

And second, there seems to be a node compatibility issue.

Now i am sure that i can't covert it to deno. Thanks

4 Answers

There is Denoify.
This tool takes as input a TypeScript codebase that was meant to target node and/or the web and spits out a modified version of the source files that are ready to be deployed as a Deno module.
It also helps to deploy on both NPM and deno.land/x

However, it is still under active development, not all node builtins are supported yet and you will probably have to make some changes here and there on your codebase to comply with the requirement Denoify sets.

Also, I am the author.

repo

Any code you write in pure JavaScript or TypeScript will work both in Node.js and Deno.

However, it's more than likely you have used Node.js-specific features in your current project. requires, calls to native Node.js APIs like http, util, and many others will not work in the Deno runtime.

Also, these kinds of Node.js-specific APIs are used in most Node.js libraries, so you'll have to do a complete rewrite to Deno.

You're using many npm packages in your node project.Deno doesn't work with them.So either you'll wait to deno to be mature enough or you're gonna keep building your projects with node until that time.So i think if you want to take full advantage of deno, you should wait for deno to mature

I am not sure enough but as you have a Node.js project you should be using npm packages so until and unless those npm packages you use have alternative Deno packages it is possible but if not then as @IsaToltar said to wait for it to be mature enough.

but if you can tell us what third party npm packages you use then we might be able to find an alternative Deno package for that.

I hope it helps.

Related