gulp-topological-pipe

2.0.0 • Public • Published

gulp-topological-packages

Stream intended to be used with gulp which is designed to run a command on multiple packages. The stream provides every package sorted topologically.

Example

Here is a small example shoing how a command would be executed on multiple projects inside a folder called local_packages.

const gulp = require('gulp');
const topo = require('gulp-topological-pipe');
const through2 = require('through2');

gulp.task('for-each-package', () => {
    return gulp.src(
    [
        './local_packages/**/package.json',      // Glob matching all the package.json files in the local_packages directory
        '!./local_packages/**/node_modules/**/*' // Glob to exclude things located in a node_modules directory just in case
    ])
    .pipe(topo.Packages.SortedPackages())
    .pipe(through2(
        {objectMode: true}, // Must be true because SortedPacakges is an object stream
        (package, enc, callback => {
            // Do stuff with package. See: doc/classes/_package_.package.html to learn about the package fields
            callback(); // Finish this stream 
        }));
});

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-topological-pipe

Weekly Downloads

1

Version

2.0.0

License

BSD-3-Clause

Last publish

Collaborators

  • netogallo