You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
const{ promisify }=require('util')constfs=require('fs')promisify(fs.readFile)('/hello.txt','utf-8')// work well.then(console.log.bind(console)).catch(console.log.bind(console))// but...when I use `memory-fs` in my project...constMemoryFileSystem=require('memory-fs')constfs=newMemoryFileSystem()promisify(fs.readFile)('/hello.txt','utf-8')// dose not work.then(console.log.bind(console)).catch(console.log.bind(console))// I need write this way `promisify(fs.readFile.bind(fs))` to make it work well,// I think `memory-fs` should do this for users. is this an issue ?
The text was updated successfully, but these errors were encountered:
It's because of how MemoryFileSystem is a class. It doesn't really need to be - I might fork this if they don't intend to fix this, because it's kind of annoying. Native fs doesn't need bind, this package should work the same so that it's a drop in replacement and you don't have to change your client code.
The text was updated successfully, but these errors were encountered: