0.2.0 • Published 9 years ago

loopback-promisify v0.2.0

Weekly downloads
298
License
MIT
Repository
-
Last release
9 years ago

#loopback-promisify

loopback-promisify adds promises to your loopback models. if something is missing, you can extend it in easy way.

##Installation

Install module

npm install --save loopback-promisify

and next in server/server.js, after boot add one line:

require('loopback-promisify')(app)

##Configuration

In json files with model definitions:

...
"options": {
	"promisify": true
}
...

Promisify adds promises to default CRUD methods, if you want to add it to your custom method, you can do it in this way:

Model.myCustomMethod = function(next) {
	next();
}
Model.myCustomMethod.promisify = true;

##Custom methods

From version 0.1.5 promises can be add to custom methods, not only for models.

var promisify = require('loopback-promisify');

function customMethod(param, param2, callback) {
    //...
}

promisify.fn(customMethod);
0.2.0

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.0.1

9 years ago