TypeScript 4.7, which is already in the candidate release stage (RC), offers support for the ECMAScript (ESM) module for Node.js 16, as well as a number of coding enhancements.

The RC was unveiled on May 11. TypeScript 4.7 is the latest planned version of Microsoft’s highly advanced JavaScript. The TypeScript 4.7 beta introduced on April 8 supported ECMAScript module support in Node.js 12, something that was planned for TypeScript 4.5 late last year but was delayed.

However, since Node.js 12 is no longer supported, the creators of TypeScript have launched a stable goal in Node.js 16, which should provide newer functionality of the ES module, such as. template trailers while setting the default TypeScript to a higher target that supports the highest level await.

Night-only support for ECMAScript modules in Node.js was introduced during the TypeScript 4.5 time period. These modules allow reuse of code through packaging. Implementing this support was difficult because Node.js was built on a different modular system, CommonJS. TypeScript 4.7 adds this functionality with two module Settings, node12 and nodenext. Feedback on this ability is sought and can be offered GitHub.

TypeScript 4.7 should be publicly available on May 24. RC can be accessed via NuGet or NPM:

npm install typescript@rc

Copyright © 2022 IDG Communications, Inc.

https://www.infoworld.com/article/3656801/typescript-47-adds-esm-support-in-nodejs.html#tk.rss_all

Previous articleSD Times Open Source Project of the Week: Cloudflare Workers
Next articleTurning the leap of faith into a whole new vocation