2.0.0 • Published 10 years ago
grunt-as-promised v2.0.0
Grunt as promised 
If you wish to be a success in the world, promise everything, deliver nothing. (Napoleon Bonaparte)
Grunt as promised helps you write async custom tasks through promises
Installation
npm install grunt-as-promised --save-devUsage
Require grunt-as-promised in your Gruntfile.js:
var gap = require('grunt-as-promised');Then enhance grunt:
gap.configure(grunt);Finally use grunt.registerPromiseTask to define tasks as functions returning a promise:
grunt.registerPromiseTask('inline', function () {
return doSomething().then(function() {
return doSomethingElse();
});
};Examples
var gap = require('grunt-as-promised');
module.exports = function (grunt) {
gap.configure(grunt);
grunt.registerPromiseTask('inline', function () {
// ...
};
};More examples are available in examples.