diff --git a/advanced/typescript.md b/advanced/typescript.md index 33fc5b91..88c86ce3 100644 --- a/advanced/typescript.md +++ b/advanced/typescript.md @@ -1,6 +1,13 @@ # Using TypeScript -In this chapter we will discuss: +Deno not only supports TypeScript out of the box, but also treats TypeScript as +a first class language. This means the developer experience when authoring and +importing TypeScript will be as easy and straightforward as that of JavaScript. + +You can run or import TypeScript without installing anything more than the Deno +CLI. + +In this chapter, we'll discuss: - [Overview of TypeScript in Deno](./typescript/overview.md) - [Configuring TypeScript in Deno](./typescript/configuration.md) diff --git a/basics/permissions.md b/basics/permissions.md index 9bf64e91..0ec539f2 100644 --- a/basics/permissions.md +++ b/basics/permissions.md @@ -4,6 +4,18 @@ Deno is secure by default. Therefore, unless you specifically enable it, a program run with Deno has no file, network, or environment access. Access to security sensitive functionality requires that permissions have been granted to an executing script through command line flags, or a runtime permission prompt. +This is a major difference from Node, where dependencies are automatically +granting full access to everything, introducing hidden vulnerabilities in your +project. + +## Run untrusted code with confidence + +Since Deno provides no I/O access by default, it's useful for running untrusted +code and auditing third-party code. If you're building or extending a platform +that runs user generated code, you can use Deno for running third-party code +securely and host this code through +[Deno Subhosting](https://deno.com/subhosting) or any other cloud platform of +your choice. For the following example `mod.ts` has been granted read-only access to the file system. It cannot write to the file system, or perform any other security diff --git a/introduction.md b/introduction.md index 8ba9264f..d10af0ba 100644 --- a/introduction.md +++ b/introduction.md @@ -11,8 +11,8 @@ It's built on V8, Rust, and Tokio. - Provides [web platform functionality](./runtime/web_platform_apis.md) and adopts web platform standards. For example using ES modules, web workers, and support `fetch()`. -- Secure by default. No file, network, or environment access unless explicitly - enabled. +- [Secure by default](./basics/permissions.md). No file, network, or environment + access unless explicitly enabled. - Supports [TypeScript](./advanced/typescript.md) out of the box. - Ships a single executable (`deno`). - Provides built-in [development tooling](./tools.md) like a code formatter @@ -27,7 +27,7 @@ It's built on V8, Rust, and Tokio. ## Philosophy -Deno aims to be a productive and secure scripting environment for the modern +Deno aims to be a productive, secure, and performant runtime for the modern programmer. Deno will always be distributed as a single executable. Given a URL to a Deno diff --git a/runtime/web_platform_apis.md b/runtime/web_platform_apis.md index 222b2d46..77c46785 100644 --- a/runtime/web_platform_apis.md +++ b/runtime/web_platform_apis.md @@ -1,12 +1,13 @@ # Using Web Platform APIs -Deno aims to use web platform APIs (like `fetch`) instead of inventing a new -proprietary API where it makes sense. These APIs generally follow the -specifications and should match the implementation in Chrome and Firefox. In -some cases it makes sense to deviate from the spec slightly, because of the -different security model Deno has. +One way Deno simplifies web and cloud development is by using Web Platform APIs +(like `fetch`) over proprietary APIs. This means if you've ever built for the +browser, you're likely already familiar with Deno, and if you're learning Deno, +you're also investing in your knowledge of the web. -Here is a list of web platform APIs Deno implements: +## Supported APIs + +Here's a partial list of supported web platform APIs in Deno: - [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - [BroadcastChannel](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel) @@ -34,7 +35,12 @@ Here is a list of web platform APIs Deno implements: - [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) You can find the Deno reference for these APIs -[here](https://deno.land/api@$CLI_VERSION). +[here](https://deno.land/api@$CLI_VERSION). To check if a Web Platform API is +available in Deno, click on +[the interface on MDN](https://developer.mozilla.org/en-US/docs/Web/API#interfaces) +and refer to +[its Browser Compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/AbortController#browser_compatibility) +(link as an example). ## `fetch` API diff --git a/tools.md b/tools.md index 115d90d5..5323a300 100644 --- a/tools.md +++ b/tools.md @@ -1,18 +1,27 @@ # Built-In Tooling -Deno provides some built-in tooling that is useful when working with JavaScript -and TypeScript: - -- [start new project (`deno init`)](./tools/init.md) -- [benchmarker (`deno bench`)](./tools/benchmarker.md) -- [bundler (`deno bundle`)](./tools/bundler.md) -- [compiling executables (`deno compile`)](./tools/compiler.md) -- [installer (`deno install`)](./tools/script_installer.md) -- [dependency inspector (`deno info`)](./tools/dependency_inspector.md) -- [documentation generator (`deno doc`)](./tools/documentation_generator.md) -- [formatter (`deno fmt`)](./tools/formatter.md) -- [linter (`deno lint`)](./tools/linter.md) -- [repl (`deno repl`)](./tools/repl.md) -- [task runner (`deno task`)](./tools/task_runner.md) -- [test runner (`deno test`)](./basics/testing.md) -- [vendoring dependencies (`deno vendor`)](./tools/vendor.md) +Deno ships with a robust toolchain so you can start building immediately without +needing to setup a disparate set of tooling. + +Deno's modern tooling is categorized below: + +## Develop + +- [start a new project: `deno init`](./tools/init.md) +- [linter: `deno lint`](./tools/linter.md) +- [formatter: `deno fmt`](./tools/formatter.md) +- [typechecker: `deno check`](./advanced/typescript/overview.md#type-checking) +- [task runner: `deno task`](./tools/task_runner.md) +- [generate documentation: `deno doc`](./tools/documentation_generator.md) +- [inspect dependencies: `deno info`](./tools/dependency_inspector.md) +- [vendor dependencies: `deno vendor`](./tools/vendor.md) + +## Test + +- [test runner: `deno test`](./basics/testing.md) +- [benchmark: `deno bench`](./tools/benchmarker.md) + +## Distribute + +- [compile to a single executable: `deno compile`](./tools/compiler.md) +- [installer: `deno install`](./tools/script_installer.md)