github nodejs/node v15.5.0
2020-12-22, Version 15.5.0 (Current), @targos

latest releases: v18.20.5, v23.2.0, v22.11.0...
3 years ago

Notable Changes

Extended support for AbortSignal in child_process and stream

The following APIs now support an AbortSignal in their options object:

  • child_process.spawn()

Calling .abort() on the corresponding AbortController is similar to calling .kill() on the child process except the error passed to the callback will be an AbortError:

const controller = new AbortController();
const { signal } = controller;
const grep = spawn('grep', ['ssh'], { signal });
grep.on('error', (err) => {
  // This will be called with err being an AbortError if the controller aborts
});
controller.abort(); // stops the process
  • new stream.Writable() and new stream.Readable()

Calling .abort() on the corresponding AbortController will behave the same way as calling .destroy(new AbortError()) on the stream:

const { Readable } = require('stream');
const controller = new AbortController();
const read = new Readable({
  read(size) {
    // ...
  },
  signal: controller.signal
});
// Later, abort the operation closing the stream
controller.abort();

Contributed by Benjamin Gruenbaum #36431, #36432.

BigInt support in querystring.stringify()

If querystring.stringify() is called with an object that contains BigInt values, they will now be serialized to their decimal representation instead of the empty string:

const querystring = require('querystring');
console.log(querystring.stringify({ bigint: 2n ** 64n }));
// Prints: bigint=18446744073709551616

Contributed by Darshan Sen #36499.

Additions to the C++ embedder APIs

A new IsolateSettingsFlag is available for those calling SetIsolateUpForNode(): SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK can be used to prevent Node.js from setting a custom callback to prepare stack traces.

Contributed by Shelley Vohr #36447.


Added node::GetEnvironmentIsolateData() and node::GetArrayBufferAllocator() to respectively get the current IsolateData* and, from it, the current Node.js ArrayBufferAllocator if there is one.

Contributed by Anna Henningsen #36441.

New core collaborator

With this release, we welcome a new Node.js core collaborator:

Commits

Semver-minor commits

  • [e449571230] - (SEMVER-MINOR) child_process: add signal support to spawn (Benjamin Gruenbaum) #36432
  • [25d7e90386] - (SEMVER-MINOR) http: use autoDestroy: true in incoming message (Daniele Belardi) #33035
  • [5481be8cbd] - (SEMVER-MINOR) lib: support BigInt in querystring.stringify (raisinten) #36499
  • [036ed1fafc] - (SEMVER-MINOR) src: add way to get IsolateData and allocator from Environment (Anna Henningsen) #36441
  • [e23309486b] - (SEMVER-MINOR) src: allow preventing SetPrepareStackTraceCallback (Shelley Vohr) #36447
  • [6ecbc1dcb3] - (SEMVER-MINOR) stream: support abortsignal in constructor (Benjamin Gruenbaum) #36431

Semver-patch commits

  • [1330995b80] - build,lib,test: change whitelist to allowlist (Michaël Zasso) #36406
  • [dc8d1a74a6] - deps: upgrade npm to 7.3.0 (Ruy Adorno) #36572
  • [b6a31f0a70] - deps: update archs files for OpenSSL-1.1.1i (Myles Borins) #36520
  • [5b49807c3f] - deps: re-enable OPENSSL_NO_QUIC guards (James M Snell) #36520
  • [309e2971a2] - deps: various quic patches from akamai/openssl (Todd Short) #36520
  • [27fb651cbc] - deps: upgrade openssl sources to 1.1.1i (Myles Borins) #36520
  • [1f43aadf90] - deps: update patch and docs for openssl update (Myles Borins) #36520
  • [752c94d202] - deps: fix npm doctor tests for pre-release node (nlf) #36543
  • [b0393fa2ed] - deps: upgrade npm to 7.2.0 (Myles Borins) #36543
  • [cb4652e91d] - deps: update to c-ares 1.17.1 (Danny Sonnenschein) #36207
  • [21fbcb6f81] - deps: V8: backport 4bf051d536a1 (Anna Henningsen) #36482
  • [30fe0ff681] - deps: upgrade npm to 7.1.2 (Darcy Clarke) #36487
  • [0baa610c3e] - deps: upgrade npm to 7.1.1 (Ruy Adorno) #36459
  • [5929b08851] - deps: upgrade npm to 7.1.0 (Ruy Adorno) #36395
  • [deaafd5788] - dns: refactor to use more primordials (Antoine du Hamel) #36314
  • [e30af7be33] - fs: refactor to use optional chaining (ZiJian Liu) #36524
  • [213dcd7930] - http: add test for incomingmessage destroy (Daniele Belardi) #33035
  • [36b4ddd382] - http: use standard args order in IncomingMEssage onError (Daniele Belardi) #33035
  • [60b5e696fc] - http: remove trailing space (Daniele Belardi) #33035
  • [f11a648d8e] - http: add comments in _http_incoming (Daniele Belardi) #33035
  • [4b81d79b58] - http: fix lint error in incoming message (Daniele Belardi) #33035
  • [397e31e25f] - http: reafactor incoming message destroy (Daniele Belardi) #33035
  • [9852ebca8d] - http: do not loop over prototype in Agent (Michaël Zasso) #36410
  • [e46a46a4cd] - inspector: refactor to use more primordials (Antoine du Hamel) #36356
  • [728f512c7d] - lib: make safe primordials safe to iterate (Antoine du Hamel) #36391
  • [f368d697cf] - Revert "perf_hooks: make PerformanceObserver an AsyncResource" (Nicolai Stange) #36343
  • [e2ced0d401] - perf_hooks: invoke performance_entry_callback via MakeSyncCallback() (Nicolai Stange) #36343
  • [7c903ec6c8] - repl: disable blocking completions by default (Anna Henningsen) #36564
  • [d38a0ec93e] - src: remove unnecessary ToLocalChecked node_errors (Daniel Bevenius) #36547
  • [bbc0d14cd2] - src: use correct microtask queue for checkpoints (Anna Henningsen) #36581
  • [7efb3111e8] - src: remove unnecessary ToLocalChecked call (Daniel Bevenius) #36523
  • [68687d3419] - src: remove empty name check in node_env_var.cc (raisinten) #36133
  • [1b4984de98] - src: remove duplicate V macros in node_v8.cc (Daniel Bevenius) #36454
  • [5ff7f42e65] - src: use correct outer Context’s microtask queue (Anna Henningsen) #36482
  • [96c095f237] - src: guard against env != null in node_errors.cc (Anna Henningsen) #36414
  • [4f3d7bb417] - src: introduce convenience node::MakeSyncCallback() (Nicolai Stange) #36343
  • [e59788262c] - src: add typedef for CleanupHookCallback callback (Daniel Bevenius) #36442
  • [2a60e3b9df] - src: fix indentation in memory_tracker-inl.h (Daniel Bevenius) #36425
  • [210390f6fd] - src: remove identical V macro (Daniel Bevenius) #36427
  • [02afe586aa] - src: use using declarations consistently (Daniel Bevenius) #36365
  • [169406b7d7] - src: add missing context scopes (Anna Henningsen) #36413
  • [3f33d0bcda] - stream: fix pipe deadlock when starting with needDrain (Robert Nagy) #36563
  • [d8b5b9499c] - stream: accept iterable as a valid first argument (ZiJian Liu) #36479
  • [58319d5336] - tls: forward new SecureContext options (Alba Mendez) #36416
  • [fa40366276] - util: simplify constructor retrieval in inspect() (Rich Trott) #36466
  • [cc544dbfaa] - util: fix instanceof checks with null prototypes during inspection (Ruben Bridgewater) #36178
  • [13d6597b4b] - util: fix module prefixes during inspection (Ruben Bridgewater) #36178
  • [20ecc82569] - worker: fix broadcast channel SharedArrayBuffer passing (Anna Henningsen) #36501
  • [56fe9bae26] - worker: refactor MessagePort entanglement management (Anna Henningsen) #36345

Documentation commits

Other commits

Don't miss a new node release

NewReleases is sending notifications on new releases.