Paul Krill
Editor at Large

Deno 1.46 simplifies CLI

news
26 Aug 20243 mins
Development Libraries and FrameworksJavaScriptNode.js

Last 1.x release of the runtime for JavaScript and TypeScript also improves dependency management and stabilizes the standard library.

shutterstock 1591493512 dinosaur roadside attraction brontosaurus T Rex clouds blue sky
Credit: The Image Party / Shutterstock

Deno Land has released Deno 1.46, which the company says is the final 1.x release of the JavaScript/TypeScript runtime. The upgrade simplifies the command-line interface, improves dependency management and Node.js/npm compatibility, and enables multi-threaded web servers with a new --parallel flag for the deno serve command.

Deno 1.46 was announced August 22. To upgrade to Deno 1.46 developers can run the deno upgrade command in their terminal.

The CLI (command line interface) in Deno 1.46 introduces shorter invocations to offer a more ergonomic method for performing common tasks. Developers now can run a program with deno and do not have to specify the run subcommand. All necessary flags still can be passed to the deno subcommand. Another ergonomic change is an ability to run tasks via deno run.

Dependency management improvements include supporting dist tags and suggest npm packages. Developers now can use dist tags when adding npm dependencies. Also, deno add now will provide a helpful message when trying to add a package from JSR that only is available on npm. With deno remove, Deno now has a subcommand to remove a dependency from the config and lockfile. And developers can invoke a deno clean to purge the global cache used to store remote dependencies for efficient use across multiple projects.

Deno 1.46 boosts the performance of the Deno.serve() API by 8% to 15% while crypto.randomUUID() is five times faster, according to Deno Land. Further, deno serve now supports a --parallel flag that runs the server on multiple threads. Also, Response.clone() is 80% faster and deno doc has been optimized to improve memory usage. And the standard library in Deno 1.46 now is stable.

With Deno 1.46 having now arrived, a first release candidate of Deno 2 is expected shortly. Deno 2 will have some “minor” breaking changes, including API changes and deprecations. Other improvements in Deno 1.46 include:

  • The deno serve subcommand, for writing servers in a declarative way, has been made faster.
  • Improvements have been made to deno test and deno coverage, which now show breadcrumbs for easier navigation.
  • Compatibility with Node.js and npm packages has been improved, with Deno 1.46 focusing on getting several popular packages working. For example, Playwright is now supported on Linux and macOS.
  • The deno fmt command now can be used to format HTML, CSS, SCSS, Sass, Less, YAML, Astro, Angular, Svelte, and Vue files.
  • Google’s V8 12.9 JavaScript and WebAssembly engine now ships with Deno.
Exit mobile version