Setup Steps
1. Install Deno:
curl -fsSL https://deno.land/install.sh | sh2. Add to PATH (.bashrc):
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"3. Check version:
deno --version4. Run a TypeScript file:
deno run index.ts5. Run with permissions:
deno run --allow-net --allow-read server.ts6. HTTP server example:
typescript
Deno.serve({ port: 8000 }, (req) => {
return new Response("Hello Deno!")
})7. Package management (deno.json):
{
"imports": {
"oak": "https://deno.land/x/oak/mod.ts"
}
}8. Write tests:
typescript
Deno.test("addition test", () => {
const result = 2 + 3
if (result !== 5) throw new Error("Error!")
})9. Run tests:
deno test10. Deploy with Deno Deploy:
deno install -Agf jsr:@deno/deployctl
deployctl deploy --project=project-name main.ts