deno(1)
Deno is a modern runtime for JavaScript and TypeScript with built-in security, formatting, and testing capabilities.
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
| Flag | What it does |
|---|---|
--allow-read | Allow read access to file system; optionally specify paths: --allow-read=/etc,/home |
--allow-write | Allow write access to file system; optionally specify paths |
--allow-net | Allow network access; optionally specify hosts: --allow-net=example.com,api.github.com |
--allow-env | Allow access to environment variables; optionally specify names: --allow-env=PATH,HOME |
--allow-all | Grant all permissions (equivalent to -A) |
-A | Short for --allow-all; grant all permissions |
--reload | Reload source code cache; optionally specify module URLs to reload specific modules |
--inspect | Activate inspector on 127.0.0.1:9229 for debugging |
--no-check | Skip TypeScript type checking |
-q, --quiet | Suppress diagnostic output |
Examples
Run a TypeScript script directly from a URL without local installation
deno run https://deno.land/std/examples/welcome.tsRun script with explicit read/write permissions limited to current directory
deno run --allow-read=. --allow-write=. myapp.tsAuto-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-allLint 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.jsPre-fetch and cache a module, refreshing any existing cache
deno cache --reload https://deno.land/std/mod.tsGenerate documentation for all exported functions and private members in main.ts
deno doc --private main.ts