1.1.2 • Published 7 years ago
proper-fs v1.1.2
proper-fs
Node fs API tweaked for modern usage.
What?
Same as Node.js's native fs module, but with the following changes:
- Promise-based async methods. Uses Node's native
util.promisifyfor lowest possible overhead. - Sync methods included as-is.
- Deprecated methods are not included.
watchFile/unwatchFileare not included, due towatchbeing the recommended method.- Exports
isCaseSensitiveboolean after checking the current platform. - Additional helper methods:
fileExistsandfileExistsSyncdirectoryExistsanddirectoryExistsSyncensureDirectoryandensureDirectorySync
Why?
Node 8 is currently (July 2018) LTS. Async/await is natively supported, but native async fs methods are callback-based. I find myself promisifying Node's methods over and over. Node 10 already exposes Promise-based API, but I needed a low-overhead solution that works on both Current and LTS versions.
License
MIT