Closed ExpandOcean closed 2 months ago
@ExpandOcean,
Thanks for the question.
As mentioned in the 0.14.0 release notes, the change to need Node v22 is for Promise.withResolvers
. If you polyfill Promise.withResolvers
you should be able to use a lower Node version.
I think it may be a good idea to add the polyfill in ZenFS since it is trivial and would save this headache. Especially since the engine field of the NPM package wouldn't need to be 22 then.
Just to show how easy the polyfill is:
Promise.withResolvers ??= function<T>(): PromiseWithResolvers<T> {
let resolve, reject;
const promise = new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
});
return { promise, resolve, reject };
}
Thanks for your reply and the new release! I like this library and want to use it in an existing project but there will be a conflict if Node>20, the latest release should solve my problem. Thanks!
Hello, the engine requires Node.js version 22 or higher. Is there a specific feature that needs this? The current default LTS version of Node.js is 20.