Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
Published By From Node.js News · 1 min read
ReleaseNode.js 23.1.0 (Current)
When a Buffer is created using a resizable ArrayBuffer , the Buffer length will now correctly change as the underlying ArrayBuffer size is changed.
Contributed by James M Snell in #55377 .
MockTimers , introduced in April 2023, has just reached stable status . This API provides comprehensive support for mocking Date and all major timers in Node.js, including setTimeout , setInterval , and setImmediate , both from the node:timers , node:timers/promises modules and global objects. After months of refinement, developers can now fully rely on MockTimers for testing time-based operations with confidence, ensuring better control over asynchronous behavior in their Node.js applications.
Example usage with initial Date object as time set:
Contributed by Erick Wendel in #55398 .
This is an excerpt. The full article is published by Node.js News.
Answers to common questions regarding this article's topic, architecture, and practical applications.
When a Buffer is created using a resizable ArrayBuffer, the Buffer length will now correctly change as the underlying ArrayBuffer size is changed.
How It Works
When a Buffer is created using a resizable ArrayBuffer, the Buffer length
will now correctly change as the underlying ArrayBuffer size is changed. const = new (10, { : 20 });
const = .();
.(.);
10;
.(15);
.(.);
15;
.(5);
.(.);
5;JavaScript
Contributed by James M Snell in #55377.
General
MockTimers, introduced in April 2023, has just reached stable status. This
API provides comprehensive support for mocking Date and all major timers in
Node.js, including setTimeout, setInterval, and setImmediate, both from
the node:timers, node:timers/promises modules and global objects. After
months of refinement, developers can now fully rely on MockTimers for testing
time-based operations with confidence, ensuring better control over asynchron
General
The two proposals reached stage 4 of the TC39 process, at the October 2024
meeting. The Node.js implementation already matches exactly the semantics
required by the proposals. Contributed by Nicolò Ribaudo by #55333.