2.4.2 • Published 2 years ago

@haensl/pfs v2.4.2

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

pfs

NPM

npm version

CircleCI

Lightweight, dependency-free, promise wrapper around node.js' fs.

Installation

$ yarn add @haensl/pfs

# or npm
$ npm install -S @haensl/pfs

Use

Exactly how you would use fs. This is a drop-in replacement that converts any callback-based functions to promise-based ones.

const fs = require('@haensl/pfs')

// now uses promise
fs.readFile('my-file.txt', 'utf-8')
  .then((content) => {
    // do nice things
  })
  .catch(...)

// still works the same
fs.readFileSync('my-file.txt', 'utf-8')

// properties are also unchanged
fs.constants.R_OK

Credits

Based on Chris Deacy's pfs.

Changelog

License

2.4.2

2 years ago

2.4.1

3 years ago

2.4.0

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.3

6 years ago

2.2.2

7 years ago

2.2.0

7 years ago