-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outputs warning: (node:84425) ExperimentalWarning: The fs.promises API is experimental #63
Comments
How to troubleshoot this: $ node
> process.emitWarning = () => { throw new Error('foo') }
[Function]
> require('mz/fs')
Error: foo
at process.emitWarning (repl:1:37)
at Object.get [as promises] (fs.js:84:15)
at /Users/dexter/src/project/node_modules/thenify-all/index.js:62:31
at Array.forEach (<anonymous>)
at promisifyAll (/Users/dexter/src/project/node_modules/thenify-all/index.js:59:23)
at Function.withCallback (/Users/dexter/src/project/node_modules/thenify-all/index.js:33:10)
> in Object.defineProperty(fs, 'promises', {
configurable: true,
enumerable: true,
get() {
if (warn) {
warn = false;
process.emitWarning('The fs.promises API is experimental',
'ExperimentalWarning');
}
return promises;
}
}); so it is problably because |
There is a fix to Node.js up here: nodejs/node#20632 Will probably released in 10.1.1 or 10.2.0 We could potentially work around it here as well though... |
JFYI, we fixed this in fs.extra with a getter property: jprichardson/node-fs-extra#578. |
hello, is it possible to use for all |
it looks like all |
I was thinking this as well, but we should probably wait until it's not experimental though. Not nice that it always logs a warning... |
oke, awesome, thanks! take care... |
Bluebird promisifyAll is currently faster than native fs.promises but not by much fwiw. |
fwiw stands for "For What It's Worth" |
@p3x-robot first of all - I don't enjoy this interaction style. If something I'm saying is unclear please point it out and I will gladly explain it. Calling it 'weird' doesn't help. I'll give some context - I am a core team member of both Node.js and bluebird and I'm very conscious about the performance of promise operations. We are having a Node.js core summit at the end of this month and are going to discuss promise performance at it. I'm preparing some use cases and measurements for a workshop whose purpose is to discuss promise performance with the Node core and V8 so I have recently had the chance to measure this. Bluebird is often faster (and V8 users it in their benchmarks to measure their own promise performance) because it was written from the grounds up to be fast and utilize every optimization technique that existed then with deep familiarity with how V8 works and the JIT. There is absolutely no reason JS code should be slower than C++ code on V8 for this sort of thing in principle. Making the C++ as fast as bluebird (and faster) is ongoing work the V8 team is doing and they've closed a large portion fo the gap. I encourage you to check some resources on how JIT compilation works and how bluebird utilizes it. A lot of the optimization tricks the current V8 implementation does also borrow from things bluebird did (and other libraries before it!). I also encourage you to measure this yourself for your own use case (and if you make a meaningful application benchmark out of it that measures real-world performance - I promise to help you get it included in what we test performance with in Node.js). In addition - if you have any diagnostic or debugging use cases you think Node.js can be better with - then please do bring them up (here or in @nodejs/promise-use-cases). |
Hello,
Since Node v10.1.0, this package throws the warning
(node:84425) ExperimentalWarning: The fs.promises API is experimental
.Test case:
The text was updated successfully, but these errors were encountered: