The developers of Deno, which is positioned as a secure runtime for JavaScript and TypeScript and rival to Node.js, have published Deno 1.5, a new version of the platform that improves bundling and REPL capabilities.
The deno bundle
command in Deno 1.5 is billed to be as much as 15 times faster than in Deno 1.4, and now uses tree-shaking to remove unused code from the bundle. Also, work has been done to refactor Deno’s TypeScript compiler infrastructure, with aging bundler infrastructure replaced with a new bundler based on the swc TypeScript/JavaScript compiler. Bundles now are emitted as a standard ES module, with dynamic import now working correctly.
Other new features and improvements in Deno 1.5:
await
support is offered, with developers able to await
promises in the REPL without having to wrap a call in an async IIFE.isolatedModules
TypeScript compiler option enabled by default.alert
, confirm
, and prompt
have been added. The alert
API logs a message to the terminal and synchronously blocks until confirmation. The confirm
API prompts the user with a message and synchronously blocks until the user responds, while prompt
requests some input form the user and blocks synchronously until the user has entered text and pressed enter
.Deno.fsync
, Deno.fdatasync()
and synchronous counterparts stabilized. These are low-level methods to ensure modified file data is written to the disk drive. Two new unstable APIs are introduced, including Deno.sleepSync()
, to block the event loop, and Deno.systemCpuInfo()
, to get information the number of available cores and CPU speed.deno lint
has been updated with a camelcase:
rule to check if variable declrations use camelCase
formatting. Hints for lint diagnostics are introduced, as well.ssertStringContains
and assertArrayContains
methods in std/testing.asserts.ts to asssertStringIncludes
and assertArrayIncludes
, respectively, to match the naming of the includes
method on strings and arrays.deno fmt --ignore
flag now is available without the --unstable
flag. The flag can be used to ignore some files or folders from being formatted or checked by the formatter.#deno #node #javascript #typescript #developer