Deno Chinese Manual 1.0 has been released, please visit Github Pages to learn more.

Introduction to the

Deno is a JavaScript/TypeScript runtime that is secure by default and has an excellent development experience.

Deno is built on V8, Rust, and Tokio.

Function highlights

  • Security by default. External code has no file system, network, or environment access unless explicitly enabled.

  • Support for TypeScript out of the box.

  • Distribute only a single executable (denO).

  • There are built-in toolkits, such as a dependency viewer (deno Info) and a code formatter (deno FMT).

  • There is a standard set of audited modules that are guaranteed to work on Deno.

  • Script code can be packaged as a single JavaScript file.

philosophy

Deno aims to provide an efficient and secure scripting environment for modern programmers.

It will always be distributed as a single executable, and that executable will be able to run any Deno program. Given the URL of a Deno program, you should be able to run it with a Deno executable that is no more than 15 MB compressed.

Deno explicitly assumes the role of runtime and package manager. It uses a standard browser compatibility protocol (URL) to load modules.

Deno is an excellent alternative to the tool scripts that used to be written in Bash or Python.

The target

  • Distribute only a single executable (denO).

  • Security by default. External code has no file system, network, or environment access unless explicitly enabled.

  • Browser compatibility: Programs written entirely in JavaScript that do not use the global Deno namespace (or functional testing) are a subset of Deno programs and should be able to run directly in modern browsers without changes.

  • Provide built-in tools to enhance the development experience, such as unit testing, code formatting, and code review.

  • Do not leak V8 concepts into user space.

  • Ability to provide HTTP services efficiently

Comparison with Node.js

  • Instead of using NPM, Deno references modules using urls or file paths.

  • Deno does not use package.json in its module parsing algorithm.

  • All asynchronous operations in Deno return promises, so Deno provides a different API than Node.

  • Deno requires explicit file, network, and environment permissions.

  • Deno always exits unexpectedly when uncaught errors occur.

  • Using the ES module, require() is not supported. Third-party modules are imported by URL. import * as log from “https://deno.land/std/log/mod.ts”;

Other key behaviors

  • Remote code is fetched and cached on the first run until the code is run with the –reload option. (So it works on airplanes.)

  • Modules or files loaded from remote urls should be immutable and cacheable.

contribution

If you would like to participate in documentation improvement, please submit a Pull request to Nugine/deno-manual-cn.

Participants: @Nugine, @sbwww, @symbioticstar, @gylidian, @JustJavac