A secure TypeScript runtime on V8
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build_extra build: fix rust temp file conflicts during parallel build Aug 26, 2018
js refactor: add and use libdeno.setGlobalErrorHandler instead of window… Aug 26, 2018
libdeno format Aug 26, 2018
src Replaced read_file_sync{_string} with std::fs::read{_to_string} Aug 26, 2018
tests Improve DenoCompiler.makeDefine and localRequire Aug 23, 2018
third_party @ 09acc06 Upgrade flatbuffers Aug 24, 2018
tools tools/format: fix clang-format glob pattern Aug 26, 2018
.appveyor.yml build: fix rust temp file conflicts during parallel build Aug 26, 2018
.gitattributes Create .gitattributes Jul 13, 2018
.gitignore Prevent circular imports in ts code (#576) Aug 25, 2018
.gitmodules Update repo links to denoland. Aug 3, 2018
.gn chore: introduce rust_treat_warnings_as_errors build arg Aug 14, 2018
.prettierignore Remove msg_generated hack (#409) Jul 26, 2018
.travis.yml travis: allow cache to be saved when build takes too long Aug 24, 2018
BUILD.gn build: fix typescript dirs not correctly rebased Aug 26, 2018
Cargo.toml Add hyper dependencies Aug 20, 2018
LICENSE Update LICENSE Jun 1, 2018
README.md Update Readme with link to releases. Aug 23, 2018
Roadmap.md Replace protobuf with flatbuffer Aug 3, 2018
build move v8 to third_party/v8 (#322) Jul 3, 2018
build_overrides move v8 to third_party/v8 (#322) Jul 3, 2018
buildtools move v8 to third_party/v8 (#322) Jul 3, 2018
gclient_config.py Upgrade flatbuffers Aug 24, 2018
node_modules chore: reorganize symlinks Jul 6, 2018
package.json Use unit_tests for readFileSync testing. Aug 11, 2018
rollup.config.js Generate declarations Aug 8, 2018
testing move v8 to third_party/v8 (#322) Jul 3, 2018
tsconfig.json Use typescript strict mode (#505) Aug 15, 2018
tslint.json format Aug 26, 2018

README.md

deno

Linux Windows
Travis Appveyor

A secure TypeScript runtime built on V8

  • Supports TypeScript 3.0.1 out of the box. Uses V8 6.9.297. That is, it's very modern JavaScript.

  • No package.json. No npm. Not explicitly compatible with Node.

  • Imports reference source code URLs only.

    import { test } from "https://unpkg.com/deno_testing@0.0.5/testing.ts"
    import { log } from "./util.ts"
    

    Remote code is fetched and cached on first execution, and never updated until the code is run with the --reload flag. (So, this will still work on an airplane. See ~/.deno/src for details on the cache.)

  • File system and network access can be controlled in order to run sandboxed code. Defaults to read-only file system access and no network access. Access between V8 (unprivileged) and Rust (privileged) is only done via serialized messages defined in this flatbuffer. This makes it easy to audit. To enable write access explicitly use --allow-write and --allow-net for network access.

  • Single executable:

    > ls -lh out/release/deno
    -rwxr-xr-x  1 rld  staff    48M Aug  2 13:24 out/release/deno
    > otool -L out/release/deno
    out/release/deno:
     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
     /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
     /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.51.6)
     /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
    >
    
  • Always dies on uncaught errors.

  • Supports top-level await.

  • Aims to be browser compatible.

Status

Under development.

We make binary releases here.

Progress towards future releases is tracked here.

Roadmap is here. Also see this presentation.

Chat room.

Build instructions

To ensure reproducable builds, Deno has most of its dependencies in a git submodule. However, you need to install separately:

  1. Rust
  2. Node
  3. Python 2. Not 3.
  4. ccache (Optional but helpful for speeding up rebuilds of V8.) .

To build:

# Fetch deps.
git clone --recurse-submodules https://github.com/denoland/deno.git
cd deno
./tools/setup.py

# Build.
./tools/build.py

# Run
./out/debug/deno tests/002_hello.ts

Other useful commands:

# Call ninja manually.
./third_party/depot_tools/ninja -C out/debug
# Build a release binary.
DENO_BUILD_MODE=release ./tools/build.py :deno
# List executable targets.
./third_party/depot_tools/gn ls out/debug //:* --as=output --type=executable
# List build configuation.
./third_party/depot_tools/gn args out/debug/ --list
# Edit build configuration.
./third_party/depot_tools/gn args out/debug/
# Describe a target.
./third_party/depot_tools/gn desc out/debug/ :deno
./third_party/depot_tools/gn help

Env vars: DENO_BUILD_MODE, DENO_BUILD_PATH, DENO_BUILD_ARGS.