Skip to content

Gozala/promised-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

promised-fs

Provides defer/when style promise based filesystem API for node.js. This alternative API allows writing code in a liniar fasion while still preserving asynchronous behavior.

Example

    var fs = require('promised-fs')
    ,   when = require('q').when

    var somePath = fs.workingDirectory().join('someFile.bla')
    var data = fs.read(somePath)
    var wroteTemp = fs.write('/some/path/temp.bla', data)

    when
    ( wroteTemp
    , function resovled() {
        doSomethingNow()
      }
    , function rejected(error) {
        doSomethingElseIfFailed(error)
      }
    )

Install

npm install promised-fs

Test

npm test promised-fs

About

defer/when style promise based filesystem API for NodeJS

Resources

Stars

Watchers

Forks

Packages

No packages published