
Deno Has a Free API: The JavaScript Runtime That Fixed Node.js
Ryan Dahl created Node.js. Then he created Deno to fix everything he regretted about Node. What Is Deno? Deno is a JavaScript/TypeScript runtime with security, built-in tooling, and web standard APIs. No node_modules . No package.json . No tsconfig.json . No webpack.config.js . // server.ts — that's the whole file name, no config needed Deno . serve (( req : Request ) => { const url = new URL ( req . url ); if ( url . pathname === " /api/hello " ) { return Response . json ({ message : " Hello from Deno! " }); } return new Response ( " Not found " , { status : 404 }); }); deno run --allow-net server.ts # Server running on http://localhost:8000 TypeScript works out of the box. No ts-node . No tsc . No tsconfig.json . Security by Default # This FAILS — no permissions granted deno run script.ts # Explicit permissions deno run --allow-net --allow-read = ./data script.ts # Prompted permissions deno run --prompt script.ts Node.js: your npm package can read your SSH keys, send them to a server
Continue reading on Dev.to JavaScript
Opens in a new tab


