promisified-fs

1.0.1 • Public • Published

promisified-fs

node version npm version build status code style

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')
    // do something
}

License

MIT

Package Sidebar

Install

npm i promisified-fs

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • cnlon