Deno Touching repository

play-with-deno

deno Touching repository

what is deno?

  • a JavaScript/TypeScript runtime with secure defaults and a great developer experience. made by Ryan Dahl who is also author of Node.js
  • released v1.0 on 2020/05/13.
  • speach by author with retrospective of Node.js: https://youtu.be/M3BM9TB-8yA?t=987

in conclusion

  • The ecosystem is very well made and comfortable to touch. However, since various libraries are still overwhelmingly lacking for Node.js, is it still difficult to use in production? OSS commit chance! !! !!✊

Feature

  • The official icon is cute
  • Secure by default. No file, network, or environment access (unless explicitly enabled) (More detail: https://deno.land/manual@v1.4.4/getting_started/permissions)
  • Supports TypeScript by default.
  • Ships a single executable
  • Has built-in utilities(e.g. dependency inspector, code formatter)
  • There is a standard library. (It seems to be imported from Go) https://deno.land/std@0.73.0
  • Scripts can be bundled into a single JavaScript file.

What is different from Node.js?

  • does not use npm (module URLs instead of it)
  • does not use package.json in its module resolution algorithm.(he says it’s a noise.)
  • All async actions return a promise. (good bye callback hell)

cf: https://deno.land/manual#comparison-to-nodejshttps://qiita.com/so99ynoodles/items/c3ba2a528052827e3b3c

What i did

Follow up to 1.Introduction, 2.Getting Started (up to 2.3 First steps) at https://deno.land/manual , and some 6. Examples. And a little code like that.

  1. setup
$ brew install deno
$ deno --version
deno 1.4.4
v8 8.7.75
typescript 4.0.3
  1. install deno extension for VSCode

  2. getting started

$ deno run https://deno.land/std@0.73.0/examples/welcome.ts
Download https://deno.land/std@0.73.0/examples/welcome.ts
Check https://deno.land/std@0.73.0/examples/welcome.ts
Welcome to Deno 🦕
  1. getting started with local code
  2. https://deno.land/manual@v1.4.4/examples/hello_world
$ deno run hello-world.ts
Hello John
Hello Sarah
Hello Kai
  1. webserver.ts https://deno.land/manual@v1.4.4/examples/http_server
$ deno run --allow-net webserver.ts
Check file:///Users/shogokakinouchiv2/study/play-with-deno/webserver.ts
HTTP webserver running.  Access it at:  http://localhost:3000/

 This is a playful guy.


It’s kind of like that from here.

  1. I’ll try the endpoint. Select https://github.com/sholladay/pogo as the
  2. framework . https://github.com/kakinouchi/play-with-deno/blob/main/src/application/sample/sample.controller.ts
  3. I will write a test. https://github.com/kakinouchi/play-with-deno/blob/main/test/application/sample/sample.presenter.test.ts
  4. working with pm2

A little addicted / bonus

$ deno install -qAf --unstable https://deno.land/x/denon@2.4.0/denon.ts
  • From now on, use commands denoinstead of denoncommands. (It’s hard to understand! And it looks like a little bug!-It’s just unstable.)

reference

Download Details:

Author: kakinouchi

Source Code: https://github.com/kakinouchi/play-with-deno

#deno #node #nodejs #javascript

Deno Touching repository
2.05 GEEK