Skip to content

Grunt as promised helps you write async custom tasks through promises

License

Notifications You must be signed in to change notification settings

arpinum/grunt-as-promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grunt as promised Build Status

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-dev

Usage

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.

License

MIT

About

Grunt as promised helps you write async custom tasks through promises

Resources

License

Stars

Watchers

Forks

Packages

No packages published