$linuxjunkies
>

deno(1)

Deno is a modern runtime for JavaScript and TypeScript with built-in security, formatting, and testing capabilities.

UbuntuDebianFedoraArch

Synopsis

deno [SUBCOMMAND] [OPTIONS] [ARGS]

Description

Deno is a secure runtime for JavaScript and TypeScript that executes code in a sandboxed environment. Unlike Node.js, Deno enforces explicit permission grants for file system access, network access, and environment variables, making it safer by default.

Deno includes a built-in toolchain with TypeScript support, code formatting (deno fmt), linting (deno lint), testing (deno test), and bundling capabilities, eliminating the need for external build tools and package managers in many cases.

Common options

FlagWhat it does
--allow-readAllow read access to file system; optionally specify paths: --allow-read=/etc,/home
--allow-writeAllow write access to file system; optionally specify paths
--allow-netAllow network access; optionally specify hosts: --allow-net=example.com,api.github.com
--allow-envAllow access to environment variables; optionally specify names: --allow-env=PATH,HOME
--allow-allGrant all permissions (equivalent to -A)
-AShort for --allow-all; grant all permissions
--reloadReload source code cache; optionally specify module URLs to reload specific modules
--inspectActivate inspector on 127.0.0.1:9229 for debugging
--no-checkSkip TypeScript type checking
-q, --quietSuppress diagnostic output

Examples

Run a TypeScript script directly from a URL without local installation

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

Run script with explicit read/write permissions limited to current directory

deno run --allow-read=. --allow-write=. myapp.ts

Auto-format all TypeScript and JavaScript files in the src/ directory

deno fmt src/

Run all test files (*_test.ts, *.test.ts) with full permissions

deno test --allow-all

Lint all files in src/ directory for code style and potential errors

deno lint src/

Bundle a TypeScript application and dependencies into a single JavaScript file

deno bundle main.ts bundle.js

Pre-fetch and cache a module, refreshing any existing cache

deno cache --reload https://deno.land/std/mod.ts

Generate documentation for all exported functions and private members in main.ts

deno doc --private main.ts

Related commands