Skip to content

haensl/pfs

master
Switch branches/tags
Code
This branch is 36 commits ahead, 15 commits behind chrisdothtml:master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.8%
  • Shell 1.2%