get-gulp-tasks

Get the gulp tasks from a gulp project

Usage no npm install needed!

<script type="module">
  import getGulpTasks from 'https://cdn.skypack.dev/get-gulp-tasks';
</script>

README

get-gulp-tasks Build Status

Get the gulp tasks from a gulp project

It spawns the local gulp binary in the specified directory and fetches the gulp tasks.

Install

$ npm install --save get-gulp-tasks

Usage

Imagine a gulpfile.js in ./gulp-project:

const gulp = require('gulp');

gulp.task('default', () => {});
gulp.task('test', () => {});

You can get its tasks with:

const getGulpTasks = require('get-gulp-tasks');

getGulpTasks('gulp-project').then(tasks => {
    console.log(tasks);
    //=> ['default', 'test']
});

API

getGulpTasks([path])

Returns a promise.

path

Type: string
Default: process.cwd()

Path to the directory of your gulp project.

License

MIT © Sindre Sorhus