prettydiff / share-file-systems

Use a Windows/OSX like GUI in the browser to share files cross OS privately. No cloud, no server, no third party.
GNU Affero General Public License v3.0
140 stars 10 forks source link

readdir using option withFileTypes: true #201

Closed prettydiff closed 1 year ago

prettydiff commented 1 year ago

Investigate using option withFileTypes on readdir in the directory.ts file for performance and simplicity.

prettydiff commented 1 year ago

Even on the returned Dirent types you must still call the type checking methods to determine the file system artifact type. As a result there is no value gain here.

https://nodejs.org/dist/latest-v20.x/docs/api/fs.html#class-fsdirent

Interestingly there is now a recursive option as of Node version 20.1.0. With that option I may not have starting writing this library (7 or 8 years ago) and thus not this project. The recursive option cannot be used now as it would break the depth option this project provides.