{"id":13527170,"url":"https://github.com/robatron/gulp-chug","last_synced_at":"2025-03-17T03:31:37.323Z","repository":{"id":13638369,"uuid":"16331761","full_name":"robatron/gulp-chug","owner":"robatron","description":"Run external gulpfiles as part of a gulp task inside another gulpfile","archived":false,"fork":false,"pushed_at":"2016-02-13T20:53:45.000Z","size":95,"stargazers_count":62,"open_issues_count":2,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T02:40:07.405Z","etag":null,"topics":["gulp","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"thebitllc/WopiBasicEditor","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robatron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-29T01:08:29.000Z","updated_at":"2021-11-03T17:49:48.000Z","dependencies_parsed_at":"2022-09-12T10:41:44.399Z","dependency_job_id":null,"html_url":"https://github.com/robatron/gulp-chug","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatron%2Fgulp-chug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatron%2Fgulp-chug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatron%2Fgulp-chug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatron%2Fgulp-chug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robatron","download_url":"https://codeload.github.com/robatron/gulp-chug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841207,"owners_count":20356443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gulp","javascript","nodejs"],"created_at":"2024-08-01T06:01:42.473Z","updated_at":"2025-03-17T03:31:36.986Z","avatar_url":"https://github.com/robatron.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gulp-chug [![NPM version][npm-badge-img]][npm-url] [![Build Status](https://travis-ci.org/robatron/gulp-chug.png?branch=master)](https://travis-ci.org/robatron/gulp-chug) [![Dependency Status](https://david-dm.org/robatron/gulp-chug.png)](https://david-dm.org/robatron/gulp-chug)\n\n\u003e A [gulp][gulp-url] plugin for running external gulpfiles as part of a gulp task inside another gulpfile.\n\ngulp-chug is *non-modifying*, i.e., gulp-chug will return the same stream it\nreceives. See [Use with other plugins](#use-with-other-plugins) for an example.\n\nRequires [node](//nodejs.org) \u003e= 0.10\n\nInspired by [shama](https://github.com/shama)'s [grunt-hub](https://github.com/shama/grunt-hub).\n\n**Note:** This plugin has been [blacklisted](https://github.com/gulpjs/plugins/issues/93), however I have yet to find an example of a pattern that allows for the execution of child gulpfiles without task name collisions. If you have an example, let me know!\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/gulp-chug):\n\n```sh\nnpm install gulp-chug\n```\n\n\n## Usage\n\n### Run external gulpfiles\n\nRun one external gulpfile:\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n    gulp.src( './subproj/gulpfile.js' )\n        .pipe( chug() )\n} );\n```\n\nRun multiple external gulpfiles:\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n\n    // Find and run all gulpfiles under all subdirectories\n    gulp.src( './**/gulpfile.js' )\n        .pipe( chug() )\n} );\n```\n\n### Use with other plugins\n\ngrunt-chug will not modify streams passed to it, but will happily accept\nstreams modified by other plugins:\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\nvar replace = require( 'gulp-replace' );\n\ngulp.task( 'default', function () {\n    gulp.src( './subproj/gulpfile.js' )\n\n        // Transform stream with gulp-replace\n        .pipe( replace( 'Hello', 'Goodbye' ) )\n\n        // Run modified stream with gulp-chug\n        .pipe( chug() )\n} );\n```\n\n### Make gulp-chug faster by ignoring file contents\n\nIf gulp-chug is the only plugin in the stream, there's no need to actually read\nthe contents of the gulpfiles. Set `{ read: false }` in `gulp.src` to speed\nthings up:\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n    gulp.src( './subproj/gulpfile.js', { read: false } )\n        .pipe( chug() )\n} );\n```\n## Options\n\nGulp chug supports several options, all of which are **optional**, e.g.,\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n    gulp.src( './subproj/gulpfile.js' )\n        .pipe( chug( {\n            nodeCmd: 'node',\n            tasks:  [ 'default' ],\n            args:   [ '--my-arg-1', '--my-arg-2' ]\n        } ) );\n} );\n```\n\n### tasks\n\nThe tasks to run from each gulpfile. Default is `default`.\n\n```js\nchug( {\n    tasks: [ 'my-task-1', 'my-task-2' ]\n} )\n```\n\n### nodeCmd\n\nThe node command to spawn when running gulpfiles. Default is `node`.\n\n```js\nchug( {\n    nodeCmd: './my-node-bin'\n} )\n```\n\n### args\n\nAdditional command-line arguments to pass to each spawned process. Default is\nnone.\n\n```js\nchug( {\n    args: [ '--my-arg-1', '--my-arg-2' ]\n} )\n```\n\n## Callback\n\nYou can pass a callback function to gulp chug that will be executed after the\nexternal gulpfile has finished running.\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n\n    gulp.src( './subproj/gulpfile.js' )\n        .pipe( chug( function () {\n            console.log( 'Done' );\n        } ) )\n} );\n```\n\nIn combination with gulp-chug options:\n\n```js\nvar gulp = require( 'gulp' );\nvar chug = require( 'gulp-chug' );\n\ngulp.task( 'default', function () {\n\n    gulp.src( './subproj/gulpfile.js' )\n        .pipe( chug( {\n            tasks: [ 'my-task-1', 'my-task-2' ]\n        }, function () {\n            console.log( 'Done' );\n        } ) )\n} );\n```\n\n## See also\n\n- [gulp-hub](https://github.com/frankwallis/gulp-hub) - Load tasks from other gulpfiles\n\n## Changelog\n\n### 0.4\n\n- Add option to pass additional command-line arguments to each gulpfile\n- Update deps\n\n### 0.3\n\n- Add `nodeCmd` option to choose one's own node binary to spawn\n- Add error handling for spawned processes\n- Update deps\n\n### 0.2\n\n- Use `child_process.spawn` instead of `child_process.exec` for real-time child gulpfile output (see [exec vs spawn](http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html))\n- Implement proper unit tests\n- Fix bug where temp gulpfile would be written to the glob base instead of as a sibling to the original gulpfile\n\n### 0.1\n\n- Initial release\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Rob McGuire-Dale\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n[npm-badge-img]: https://badge.fury.io/js/gulp-chug.png\n[npm-url]: https://npmjs.org/package/gulp-chug\n[gulp-url]: https://github.com/wearefractal/gulp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobatron%2Fgulp-chug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobatron%2Fgulp-chug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobatron%2Fgulp-chug/lists"}