RunGruntTask
This npm module allows you to execute any grunt task within your app programmatically.
Why this exists?
- Grunt is a powerful tool for build/unbuild/configuring your application (Express.js etc).
- You might want to execute these grunt tasks from inside your code such develop a custom development interface for CD/CI, backup databases every 24 hours (using agenda/grunt) etc.
Installation in your project
npm install rungrunttask --save
npm install grunt --save-dev
(Else would fail)- This code looks for
Gruntfile.js
by default. It would not work without it.
Usage
var RunGruntTask = require('rungrunttask');
var taskname = 'some grunt task such as backup database every 24hours';
RunGruntTask(taskname);