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.jsby default. It would not work without it.
var RunGruntTask = require('rungrunttask'); var taskname = 'some grunt task such as backup database every 24hours'; RunGruntTask(taskname);
- [Running any grunt task as agenda function] (https://github.com/serganus/RunGruntTask-agenda)