deno官网
deno中文网
From Node to Deno
deno 安装
brew install deno
deno
A secure runtime for JavaScript and TypeScript built with V8, Rust, and Tokio.
Docs: https://deno.land/manual.html
Modules: https://github.com/denoland/deno_std
Bugs: https://github.com/denoland/deno/issues
To run the REPL:
deno
To execute a sandboxed script:
deno https://deno.land/welcome.ts
To evaluate code from the command line:
deno eval "console.log(30933 + 404)"
To get help on the another subcommands (run in this case):
deno help run
USAGE:
deno [OPTIONS] [SUBCOMMAND]
OPTIONS:
-A, --allow-all Allow all permissions
--allow-env Allow environment access
--allow-hrtime Allow high resolution time measurement
--allow-net=<allow-net> Allow network access
--allow-read=<allow-read> Allow file system read access
--allow-run Allow running subprocesses
--allow-write=<allow-write> Allow file system write access
-c, --config <FILE> Load compiler configuration file
--current-thread Use tokio::runtime::current_thread
-h, --help Prints help information
--importmap <FILE> Load import map file
-L, --log-level <log-level> Set log level [possible values: debug, info]
--no-fetch Do not download remote modules
--no-prompt Do not use prompts
-r, --reload Reload source code cache (recompile TypeScript)
--seed <NUMBER> Seed Math.random()
--v8-flags=<v8-flags> Set V8 command line options
--v8-options Print V8 command line options
-v, --version Print the version
SUBCOMMANDS:
[SCRIPT] Script to run
bundle Bundle module and dependencies into single file
completions Generate shell completions
eval Eval script
fetch Fetch the dependencies
fmt Format files
help Prints this message or the help of the given subcommand(s)
info Show info about cache or info related to source file
install Install script as executable
run Run a program given a filename or url to the source code
test Run tests
types Print runtime TypeScript declarations
version Print the version
xeval Eval a script on text segments from stdin
ENVIRONMENT VARIABLES:
DENO_DIR Set deno's base directory
NO_COLOR Set to disable color
HTTP_PROXY Set proxy address for HTTP requests (module downloads, fetch)
HTTPS_PROXY Set proxy address for HTTPS requests (module downloads, fetch)