logoDenoby example

Beginner

clideploy

Use Node.js built-in modules

Edit

Deno supports most built-in Node.js modules natively - you can include them in your code using "node:" specifiers in your imports.

Import the os module from core Node to get operating system info
import os from "node:os";
Use the module as you would in Node.js
console.log("Current architecture is:", os.arch());
console.log("Home directory is:", os.homedir());

Run this example locally using the Deno CLI:

deno run --allow-env https://examples.deno.land/node.ts