This release brings a lot of cool stuff:
ESM support
fdir now includes esm builds in addition to the commonjs build.
Thanks to @TheAlexLichter in #147
Node v12 support (is back!)
fdir v6.4.6 broke Node v12 & v14 compatibility as it made use of AbortController. We have now replaced AbortController with an in-house solution that should bring back support for Node v12.
Additionally, fdir now has the engines field set to >=12 to make it super clear what versions of Node we support.
Thanks to @SuperchupuDev & @benmccann for bringing this up and helping me test this!
Custom FS
Huge thanks to @43081j for adding support for this. You can now pass a custom FS module and fdir will make use of it instead of the Node.js fs module.
You can use it like so:
const api = new fdir({
fs: fakeFs,
}).crawl("node_modules");The fs property expects the following methods:
export type FSLike = {
readdir: typeof nativeFs.readdir;
readdirSync: typeof nativeFs.readdirSync;
realpath: typeof nativeFs.realpath;
realpathSync: typeof nativeFs.realpathSync;
stat: typeof nativeFs.stat;
statSync: typeof nativeFs.statSync;
};Other changes
- perf: use
sliceinstead ofreplacewhen joining path by @SuperchupuDev in #152 - fix: support
@types/picomatchv4 by @SuperchupuDev in #156
New Contributors
- @TheAlexLichter made their first contribution in #147
Full Changelog: v6.4.6...v6.5.0