Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

defer/when style promise based filesystem API for NodeJS

tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

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
Something went wrong with that request. Please try again.