Deno Land recently released Deno 2.3, an update of the Deno runtime that adds support for local NPM packages. Deno 2.3 also brings improvements to deno compile
.
Deno 2.3 makes testing and developing an npm package locally possible. Deno thus provides mechanisms to override dependencies, enabling developers to use custom or local versions of libraries. The mechanism is similar to npm link
in Node.js, and is configured through the patch
field in deno.json
:
{
"patch": [
"../path/to/local_npm_package"
]
}
Developers can review the provided example.
deno compile
compiles a project into a single standalone binary, thus facilitating the executable distribution. This allows distributing Deno applications to systems that do not have Deno installed. Under the hood, it bundles a slimmed-down version of the Deno runtime along with the JavaScript or TypeScript code.
Deno 2.3 extends deno compile
to support programs that use Foreign Function Interface (FFI) and Node native add-ons. FFI provides a bridge between Deno’s JavaScript runtime and native code, allowing developers to use existing native libraries within Deno applications, implement performance-critical code in languages like Rust or C, or access operating system APIs and hardware features not directly available in JavaScript.
Developers can additionally now reduce the size of executables by excluding specific files from being embedded during the compilation process (e.g., exclude development or test files from production builds).
To upgrade to Deno 2.3, developers need simply run the following command in the terminal:
deno upgrade
Deno 2.3 includes additional features, including improvements to deno fmt
(allowing developers to format embedded CSS, HTML, and SQL in tagged templates), expanded OpenTelemetry support (basic event recording, span context propagators, and more), faster dependency installation, and more. For the full list of features, developers are invited to review the release note.
Deno is open-source software that is available under the MIT license. Contributions are encouraged via the Deno Project and should follow the Deno contribution guidelines.