Skip to content

This package provides a promise based wrapper around the node fs package. Essentially, it curries the callback function, and provides a promise in its place.

Notifications You must be signed in to change notification settings

xXACCEXx/promise-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promise FS

This package provides a promise based wrapper around the node fs package. Essentially, it curries the callback function, and provides a promise in its place.

Currently this only supports a few simple interfaces, listed bellow.

  • mkdir
  • mkdtemp
  • lstat
  • readdir
  • readFile
  • writeFile
  • mkdtemp
  • rename
  • rmdir
  • unlink
  • remove

Example

let { writeFile } = require('@acce/promise-fs')

writeFile('./some.txt', 'foo bar', 'utf8')

	.then(() => do.something())
	.catch(e => console.error('Oh snap.', e))

Installing

npm i --save @acce/promise-fs

Contributing

Feel free to add extra modules, I'll merge where useful. I'm kinda slack so maybe fork?...

About

This package provides a promise based wrapper around the node fs package. Essentially, it curries the callback function, and provides a promise in its place.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published