jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 216 forks source link

Add support for `withFileTypes` in `fs.readdir` calls. #307

Open LeifAndersen opened 3 years ago

LeifAndersen commented 3 years ago

As I understand it, node v10 added withFileTypes for the options field in fs.readdir and fs.readdirSync. This returns file metadata along with file types.

https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback

It seems like BrowserFS currently doesn't have this:

> var fs = BFSRequire("fs")
> configure({fs: "LocalStorage"}, () => {console.log("Done")})
Done
> fs.readdirSync("/")
["test.txt"]
> fs.readdirSync("/", {withFileTypes: true})
["test.txt"]
james-pre commented 8 months ago

Please use https://github.com/browser-fs/core/issues/19