
Deno
A secure runtime for JavaScript
and TypeScript built with V8, Rust, and Tokio
Linux & Mac | Windows | 설명 | |
---|---|---|---|
deno | Deno 소스 저장소 | ||
deno_std | 외부 코드에 의존하지 않고 Deno 코어팀이 리뷰한 기본 모듈들 | ||
deno_install | Deno 인스톨러들 | ||
registry | Deno 를 위한 URL 리다이렉션 서비스 https://deno.land/x/ 와 모듈명과 버전명으로 구분하여 Github 등에 존재하는 소스로 이동시켜주는 서비스 |
설치하기
쉘을 사용하여 설치하기
쉘을 사용하여 설치하기
쉘을 사용하기:
curl -fsSL https://deno.land/x/install/install.sh | sh
또는 파워쉘을 사용하기:
iwr https://deno.land/x/install/install.ps1 -useb | iex
Homebrew 사용하기 (mac):
brew install deno
Scoop 사용하기 (windows):
scoop install deno
Cargo 사용하기::
cargo install deno_cli
설치에 대한 더 많은 옵션은 deno_install 를 참고하세요.
예제
간단한 프로그램을 바로 실행하기:
deno https://deno.land/welcome.ts
또는 조금 더 복잡한 프로그램 실행하기:
import { serve } from "https://deno.land/std@v0.12/http/server.ts" const body = new TextEncoder().encode("Hello World\n"); const s = serve(":8000"); window.onload = async () => { console.log("http://localhost:8000/"); for await (const req of s) { req.respond({ body }); } };