Deno

【Deno】getting start Denoの始め方

【Deno】getting start Denoの始め方

Deno

やってみた
https://deno.land/manual/getting_started/installation

brew install deno

deno --version

moritakjinoMBP2 :: ~/git/sandbox » deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2

公式
https://deno.land/#getting-started

deno run https://deno.land/std/examples/welcome.ts

// test.ts
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals("hello", "hello");
assertEquals("world", "world");
console.log("Asserted! 🎉");

適当なところにおいて実行する

moritakjinoMBP2 :: git/sandbox/deno » deno run test.ts // run
Compile file:///Users/kenjimorita/git/sandbox/deno/test.ts
Download https://deno.land/std/testing/asserts.ts
Warning Implicitly using master branch https://deno.land/std/testing/asserts.ts
Download https://deno.land/std/fmt/colors.ts
Download https://deno.land/std/testing/diff.ts
Warning Implicitly using master branch https://deno.land/std/fmt/colors.ts
Warning Implicitly using master branch https://deno.land/std/testing/diff.ts
Asserted! 🎉

run server

create

// server.ts
import { serve } from "https://deno.land/std@v0.50.0/http/server.ts";
const s = serve({ port: 5000 });
console.log("Listening on http://localhost:5000/");
for await (const req of s) {
  req.respond({ body: "Hello World!!" });
}

run

deno run --allow-net server.ts

server.ts getting start Deno
server.ts getting start Deno


「武骨日記の」プライバシーポリシーに関して
プライバシーポリシー

株式会社TerraceTechについて
最近起業しました。
株式会社TerraceTech

SNS
しずかなインターネット kenjimorita
インド旅 instagram
適当な日常写真 instagram
シュールさーん instagram
シュールさーん LINEスタンプ
もりたけんじTwitter
ネタ帳Twitter
note

FaceBook -kennji.morita-

わたしが結成しているWebチームではWeb未経験者、フリーランスの方へのお仕事を紹介しています。
また個人レッスンしてほしい生徒も募集中です。
もしご興味ある方はチャットからご連絡ください。

※業務連絡やお久しぶり連絡もチャットからお願いします。