With Deno 1.34, unveiled on May 25,
deno compile supports NPM packages. Since Deno 1.6, introduced in December 2020,
deno compile has allowed the compilation of projects into a single binary executable, which lets developers distribute and execute binaries on all major platforms without installing Deno dependencies. This feature—which simplifies deployment and speeds up startup time—has now been extended to NPM.
Prior to the Deno 1.34 release,
deno compile also added support for web workers and dynamic imports. More work is on the horizon for this feature, including minimizing total binary size.
Like last month’s Deno 1.33 release, Deno 1.34 is a precursor to a planned Deno 2 release. Other new capabilities include:
- Globs, which are patterns specifying sets of filenames with wildcard characters, are supported in the configuration file
deno.task, and CLI arguments for specifying files. The
globsyntax is cross-platform, so it can be used on Windows, MacOS, or Linux.
- TLS (transport layer security) certificates containing IP addresses are supported. This is useful for purposes such as Kubernetes pods, which often use IP addresses instead of domain names, and for DNS over HTTP/TLS, which needs an IP address for the server to avoid circular dependency on name resolution.
- For NPM and Node.js compatibility,
deno vendorhandles NPM specifiers and will no longer raise an error when encountering them. Also,
postscripts if present when executing a script from a
package.jsonfile similar to NPM.
- It’s possible to specify a
nodeModulesDirproperty in the
deno.jsonfile for explicitly enabling or disabling Deno’s use of the
Copyright © 2023 IDG Communications, Inc.