The release of the Deno 2.0 platform has been announced, designed for the isolated execution of server applications in JavaScript and TypeScript using the V8 engine, which is utilized in Chromium-based browsers. The Deno project is developed by Ryan Dahl, the creator of Node.js, with the goal of providing a more secure environment and eliminating conceptual mistakes made in Node.js architecture. To enhance security, the binding around the V8 engine is written in Rust, and the Tokio platform is used for handling requests in a non-blocking manner. The project code is distributed under the MIT license. Builds are prepared for Linux, Windows, and macOS.
In preparing the new branch, the main focus was on compatibility with the old JavaScript infrastructure and expanding the spectrum of supported JavaScript projects without compromising security. Among the changes:
- Backward compatibility with Node.js and npm has been implemented, allowing unmodified applications created for Node.js to run. The support for Node.js also enables a gradual migration of existing projects from Node.js to Deno or to connect dependencies from NPM to Deno projects by specifying the 'npm:' prefix when importing packages in deno.json.
- Built-in support for the package.json file and the node_modules directory used in Node.js has been added.
- Support for private NPM repositories defined through '.npmrc' files has been provided.
- Support for popular JavaScript frameworks such as Next.js, Astro, Remix, Angular, SvelteKit, and QwikCity has been added.
- Support for npm workspaces and monorepositories with separate dependency management has been added.
- New package management commands have been introduced: 'deno install' for installing dependencies, 'deno add' for adding packages to package.json or deno.json, and 'deno remove' for removing packages. It is noted that 'deno install' runs approximately 15 times faster than npm when there are no packages in the cache and 90% faster when a package is cached (both node_modules and its own global cache are supported).
- The standard library has been stabilized.
- A long-term support (LTS) cycle has been ensured.
- JSR has been introduced — a repository of JavaScript and TypeScript libraries that can be used in various JavaScript runtimes.
- The 'deno fmt' command now includes the ability to format content in HTML, CSS, and YAML formats.
- The command 'deno lint' has been enhanced with support for Node.js specific rules and fixes.
- The 'deno test' command now allows running tests created with node:test.
- The 'deno task' command has implemented support for running scripts through package.json.
- The 'deno compile' command now offers the option to sign code with a digital signature.
- The 'deno serve' command has implemented parallelization of HTTP server operations using multiple CPU cores.
- The 'deno coverage' command now supports saving reports in HTML format.
- Performance optimization has been conducted.

Key features of Deno:
- Security orientation in the default configuration. File access, network capabilities, and access to environment variables are blocked by default and require explicit enabling. Default applications run in isolated sandbox environments and cannot access system capabilities without explicit permissions.
- Built-in support for TypeScript alongside JavaScript. The standard TypeScript compiler is used for type checking and generating JavaScript, which results in a drop in performance compared to parsing JavaScript in V8.
- The runtime comes as a single self-contained executable file ('deno'). To run applications using Deno, simply download a single executable file for your platform, about 40 MB in size, which has no external dependencies and doesn’t require any special installation on the system. Deno is not a monolithic application but a collection of Rust crate packages (deno_core, rusty_v8) that can be used separately.
- When running a program, as well as for loading modules, addressable URL referencing can be used. For example, to run the program welcome.js, you can use the command “deno https://deno.land/std/examples/welcome.js”. Code from external sources is downloaded and cached on the local system but is never automatically updated (updating requires explicitly running the application with the flag “—reload”).
- Efficient handling of HTTP network requests in applications; the platform is designed for creating high-performance network applications.
- The ability to create universal web applications that can run both in Deno and in a regular web browser.
- A standard set of modules is available, which does not require binding to external dependencies. Modules from the standard collection have undergone additional auditing and compatibility checks.
- In addition to the runtime, the Deno platform also acts as a package manager and allows for referencing modules via URL within the code. For example, to load a module, one can specify in the code 'import * as log from "https://deno.land/std/log/mod.ts". Files loaded from external servers URLs are cached. Version binding of modules is determined by specifying version numbers within the URL, e.g., 'https://unpkg.com/liltest@0.0.5/dist/liltest.js'.
- Focus on using Web standards, support for Promise, fetch, and ECMAScript modules.
- Compatibility with packages hosted in the NPM repository and created for the Node.js platform.
- The system includes a dependency inspection tool (the 'deno info' command) and a code formatting utility (deno fmt);
- All application scripts can be bundled into a single JavaScript file.
Source: opennet.ru

