As Deno published recently, i have experienced it for a short time and being very excited for its styles of development.
let’s see a official snippet code to feel it:

## install deno
curl -fsSL https://deno.land/x/install/install.sh | sh

## run a hello world program!
deno run https://deno.land/std/examples/welcome.ts

# run a simple Http Server
import { serve } from "https://deno.land/std@0.50.0/http/server.ts";

for await (const req of serve({ port: 8000 })) {
  req.respond({ body: "Hello World\n" });
}

# run above script with --allow-net privileges opened
deno run --allow-net example.js

As you can see ,it is very simple to use! The best pros are there is no any dependencies management to do by yourself and you can import any dependency or libs on the air by using a http url !

Maybe there exists some problems here , but i think it will be a revolution in development. The development way of Deno is very suitable for cloud dev.

In most business situations , we need no BIG projects! we need no COMPLEX denpendencies like Java’s pom.xml ! But just need a piece of logic code !

And i’ve tried this, the import can be dynamic like this:

let someLib= await import('https://some_lib_url.ts?t='+new Date().getTime())
someLib.callSomeMethod(); 

It’s very convenient , isnt it?
You can imagine that you put your code at any accessble http endpoint, after you modified your code , you need to do nothing! No redeployment, no republishment ! when the customers visit your site , the changes will be effective automatic!

Last modified: 2020年5月30日

Author

Comments

Write a Reply or Comment

Your email address will not be published.