qpromisify

0.6.0 • Public • Published

qpromisify

Promise wrapper for Node.js libraries based on Q.

NPM

Installation and Usage

Set qpromisify as a dependency and install it.

npm install qpromisify

Then prefix the relevant require()s with qpromisify/:

var co = require('co')
var jsftp = require('qpromisify/jsftp')

var ftp = new jsftp(
{
    host: 'site.com',
    user: 'username',
    pass: 'password',
    port: 21,
})

// For `co` versions prior 4.0.0 use co(genFn)().
co(function*()
{
    console.log(yield ftp.ls("/"))
    console.log(yield ftp.raw.pwd())
    // Use parentheses to access origin unless constructor is promisified.
    ftp().raw.quit(function(err,res)
    {
        console.log([err,res])
    })
})//()

Dependencies

Q is required.

npm install q

Promisified libraries

Warning

This package is not production ready and intended for testing purposes only. You may find many bugs here.

Feedback

Any help is appreciated.

1GfNa7MyRnyShAKFFa7Mw86hs6phVrqBx1

Package Sidebar

Install

npm i qpromisify

Weekly Downloads

5

Version

0.6.0

License

none

Last publish

Collaborators

  • space1000