A tiny promise wrapper around fs
$ yarn add pfs
# or npm
$ npm install --save pfs
Exactly how you would use fs
. This is a drop-in replacement that converts any callback-based functions to promises
const fs = require('pfs')
// now uses promise
fs.readFile('my-file.txt', 'utf-8')
.then(...)
.catch(...)
// still works the same
fs.readFileSync('my-file.txt', 'utf-8')
// properties are also unchanged
fs.constants.R_OK