promisified-fs
1.0.1 • Public • Published promisified-fs
A promisified version of fs
.
Many fs
methods are converted into promises.
Any properties that aren't asynchronous will simply be proxied.
Installation & Usage
npm install promisified-fs
const fs = require('promisified-fs')
fs.access('filename.txt', fs.constants.W_OK)
.then(function () {
console.log('Can write!')
})
.catch(function (error) {
console.log('No access!')
})
With ES2017 async/await
:
const fs = require('promisified-fs')
async function doSomething () {
const data = await fs.readFile('filename.txt')
}
License
MIT
/promisified-fs/
//
Package Sidebar
Install
Weekly Downloads