Get the Grunt tasks from a Grunt project
npm install get-grunt-tasks
Imagine a gruntfile.js in ./grunt-project:
module.exports = grunt => {
grunt.registerTask('default');
grunt.registerTask('test');
};
You can get its tasks with:
import getGruntTasks from 'get-grunt-tasks';
console.log(await getGruntTasks('grunt-project'));
//=> ['default', 'test']
Returns a Promise<string[]> with the tasks.
Type: string
Default: process.cwd()
The path to the directory of your Grunt project.