{"id":19311753,"url":"https://github.com/emallates/gulp-task-builder","last_synced_at":"2025-04-22T14:30:50.708Z","repository":{"id":57259190,"uuid":"49209999","full_name":"Emallates/gulp-task-builder","owner":"Emallates","description":"Gulp Description Builder which can be configured by a JSON Object containing the relevant tasks to build.","archived":false,"fork":false,"pushed_at":"2021-08-30T08:00:32.000Z","size":88,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T00:06:42.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Emallates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-07T14:42:11.000Z","updated_at":"2021-08-30T08:00:34.000Z","dependencies_parsed_at":"2022-08-25T04:50:20.000Z","dependency_job_id":null,"html_url":"https://github.com/Emallates/gulp-task-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emallates%2Fgulp-task-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emallates%2Fgulp-task-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emallates%2Fgulp-task-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emallates%2Fgulp-task-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Emallates","download_url":"https://codeload.github.com/Emallates/gulp-task-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250258807,"owners_count":21400974,"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":[],"created_at":"2024-11-10T00:30:03.111Z","updated_at":"2025-04-22T14:30:48.110Z","avatar_url":"https://github.com/Emallates.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gulp Task Builder\n\nNode module task builder which can be configured by a JSON Object containing the relevant tasks to build.\n\n[![Version][version-svg]][package-url] [![Build Status][travis-svg]][travis-url]  [![Docs][docs-svg]][docs-url] [![License][license-image]][license-url]  [![Downloads][downloads-image]][downloads-url]\n\n#### DESCRIPTION\n\nNode module task builder which can be configured by a JSON Object containing the relevant tasks to build. Now you dont need to write gulp tasks in javascript just feine object then thats it.\n\n\u003c!--NO_HTML--\u003e\n\nTable of Contents\n-----------------\n**Getting Started**\n\n1. [Setup](#setup)\n  - [Install](#install)\n  - [Usage](#usage)\n  \n. [Features](#features)\n  - [Compress](#compress)\n  - [Concatenate](#concatenate)\n  - [Replace](#replace)\n  - [Rename](#rename)\n  - [Wrapper](#wrapper)\n  - [Harmony](#harmony)\n\n. [TODO](#todo)\n\n\u003c!--/NO_HTML--\u003e\n\nSetup\n============\n\n### Install\n\n```npm install gulp-task-builder -D ```\n\n### Usage\n```js\nvar builder = require('gulp-task-builder')\nvar tasks = {\n  \"task1\":{src:\"path/to/source/files\", dest:\"path/to/save\"}\n}\nbuilder.loadTasks(tasks);\nbuilder.runTasks();\n```\n**[Task Options](#task-options)**\n\nExamples\n-------------\n\n#### Basic Example \n\nwith **required** options\n```js\nvar builder = require('gulp-task-builder')\nvar tasks = {\n  \"task1\":{src:\"./src/*.js\", ext:\".js\", dest:\"dest\"},\n  \"task2\":{src:\"./packages/*.js\", ext:\".js\", dest:\"dest/lib\"}\n}\nbuilder.loadTasks(tasks);\nbuilder.runTasks();\n```\n\n#### Compress\n\nCompress your files with the `compress` option. This function is using \n\n- [gulp-uglify][gulp-uglify] for javascript\n- [gulp-htmlmin][gulp-htmlmin] for html\n- [gulp-clean-css][gulp-clean-css] for css\n- [gulp-jsonminify][gulp-jsonminify] for json\n\n```js\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", compress:true}\n{src:\"./src/*.html\", ext:\".html\", dest:\"dest\", compress:{collapseWhitespace: true}}\n{src:\"./src/*.css\", ext:\".css\", dest:\"dest\", compress:{compatibility: 'ie8'}}\n{src:\"./src/*.json\", ext:\".json\", dest:\"dest\", compress:true}\n```\n    \nfor more `css` options [Click Here][gulp-mincss-opts]\n\n#### Concatenate\n\nConcatenate (join) your files with the `concat` option. \n```js\n//File name will be task1.js which is the task name\ntask1:{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", concat:true}\n\n//File name will be jsbundle.js which is the task name\ntask1:{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", concat:true, name:\"jsbundle\"}\n\n//JSON\n//File name will be jsbundle.json which is the task name\ntask1:{src:\"./src/*.json\", ext:\".json\", dest:\"dest\", concat:true, name:\"jsonbundle\"}\n```\n\n#### Filter\n\nFilter your source files with the `filter` option.\n```js\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", filter:'!src/vendor'}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", filter:['*', '!src/vendor']}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", filter:{match:['*', '!src/vendor'], options:{restore:true, passthrough:true, dot:true}}}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", filter:function(file){ /*You can access file.cwd, file.base, file.path and file.contents */ }}\n```\nrestore and passthrough will come very soon.\n\n#### Rename\n\nRename your destination file or path. You can provide **String|Function|Object**.\n```js\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", rename:\"main/text/ciao/goodbye.md\"}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", rename:function (path) { path.dirname += \"/ciao\"; path.basename += \"-goodbye\"; path.extname = \".md\" }}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", rename:{dirname: \"main/text/ciao\", basename: \"aloha\", prefix: \"bonjour-\", suffix: \"-hola\", extname: \".md\"}}\n```\n\n#### Wrapper\n\nWrap your files or target files with the given headers and footers **Object|Array**.\n```js \n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", wrapper:{header:\"this will be header\", footer:\"this will be footer\"}}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", wrapper:[{header:\"header1\", footer:\"footer1\"}{header:\"headerN\", footer:\"footerN\"}]}\n```\n\n#### Log contents\n\nYou can also log paths contents and other stream options. In case set to true the default value will be `contents`\n```js \n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", log:true}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", preLog:true}\n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", preLog:'path'}// Console Paths\n```\n\n#### Disable save\n\nYou can also disable the save option by setting `save:false`\n```js    \n{src:\"./src/*.js\", ext:\".js\", dest:\"dest\", save:false}\n```\nTask options\n-------------\nEach task contains **REQUIRED** options which can be passed along with **OPTIONALS**(Flow Control, Plugins, Log Options).\n\n### REQUIRED\n#### Required Options\n- **src** (string) Gulp [src][g-src-rf] parameter. Path of your source files. It can be also regEx. [More Details][g-src-rf].\n- **dest** (string) Gulp [dest][g-dest-rf] parameter. Path where you want to save your files. [More Details][g-dest-rf].\n- **ext** (string) extension of file which is defined in `src` option.\n\n### OPTIONALS\n#### Flow Control\n- **runBefore** (string|Array(string)) Define task dependencies which will run before this task.\n- **save** (bool) Set `true` if you want to save your output. Default `true`.\n- **name** (string) **Recommended**. Define unique name of gulp task.\n- **order** (Array(string)) Define flow of execution. Like ['log','filter','compress','concat','wrapper'].\n\n#### Plugins\n\nThis package is using below pluging\n\n| Task | Plugin | Value Type | Description |\n| ---- | ------ | ---------- | ----------- |\n| Filter | [gulp-filter][gulp-filter] | \u003cul\u003e\u003cli\u003eObject\u003c/li\u003e \u003cli\u003eString\u003c/li\u003e \u003cli\u003eArray\u003c/li\u003e \u003cli\u003eFunction\u003c/li\u003e\u003c/ul\u003e | To filter your files. if you are sending Object then that object should have two properties [match][g-filter-opts] and options. See [gulp-filter][g-filter-api] for more details. |\n| Concat | \u003cul\u003e\u003cli\u003e[gulp-concat][gulp-concat]\u003c/li\u003e\u003cli\u003e[gulp-merge-json][gulp-merge-json]\u003c/li\u003e\u003c/ul\u003e | \u003cul\u003e\u003cli\u003eString\u003c/li\u003e\u003cli\u003eObject\u003c/li\u003e\u003c/ul\u003e | object contains two properties name and ext. |\n| Replace | [gulp-replace][gulp-replace] | \u003cul\u003e\u003cli\u003eObject\u003c/li\u003e\u003cli\u003earray(objects)\u003c/li\u003e\u003c/ul\u003e | Object can be one of these two objects `{target:\"\", src:\"\"}` this will send to [gulp-replace][gulp-replace] and second `{buildName:replacement}` buildName (string|RegExp) replacement (String|Array|Object). |\n| Debug | --- | Boolean | true, false | Enable [gulp-plumber](https://www.npmjs.com/package/gulp-plumber) |\n| Wrapper | [gulp-wrapper][gulp-wrapper] | \u003cul\u003e\u003cli\u003eObject\u003c/li\u003e\u003cli\u003eArray\u003c/li\u003e\u003c/ul\u003e | Each Object has two options header and footer. [More Details][gulp-wrapper] |\n| Harmony/ES2015 | --- | Boolean | Set it true if you need `ES6` support too. [More Details](https://www.npmjs.com/package/gulp-uglify#using-a-different-uglifyjs) | \n| Rename | [gulp-rename][gulp-rename] | \u003cul\u003e\u003cli\u003eString\u003c/li\u003e\u003cli\u003eObject\u003c/li\u003e\u003cli\u003eFunction\u003c/li\u003e\u003c/ul\u003e | You can edit the name or edit the path of your destination file. [More Details][gulp-rename] |\n| Compress | \u003cul\u003e\u003cli\u003e[gulp-uglify][gulp-uglify]\u003c/li\u003e\u003cli\u003e[gulp-htmlmin][gulp-htmlmin]\u003c/li\u003e\u003cli\u003e[gulp-clean-css][gulp-clean-css]\u003c/li\u003e\u003c/ul\u003e | \u003cul\u003e\u003cli\u003eBoolean\u003c/li\u003e\u003cli\u003eObject\u003c/li\u003e\u003c/ul\u003e | this will use [gulp-uglify][gulp-uglify] if `ext` is `.js`, [gulp-htmlmin][gulp-htmlmin] if `ext` is `.html` and [gulp-clean-css][gulp-clean-css] if `css` is `.css` |\n\n\n\n\n#### Log Options\n- **log** (string|bool) log/console content of stream. All options of [glob-stream](https://github.com/gulpjs/glob-stream) are supported. Default value is `contents`.\n- **preLog** (bool) console stream before processing. same as `log` above.\n- **postLog** (bool) console stream just before save(`gulp.dest` function) stream. same as `log` above.\n- **get** (function) Just in case if you want to get stream.**NOTE** it will not effect the stream.\n\n\n\n## Todo\n  - Use pums instead of pipe in tasks [Reason](https://github.com/terinjokes/gulp-uglify/blob/master/docs/why-use-pump/README.md#why-use-pump) and [package](https://www.npmjs.com/package/pump)\n  - Use [uglify-es][uglify-es] instead of [uglify-js-harmony][uglify-js-harmony]\n\n## License\n**MIT**\n\n\n[version-svg]: https://img.shields.io/npm/v/gulp-task-builder.svg?style=flat-square\n[travis-svg]: https://img.shields.io/travis/Emallates/gulp-task-builder/master.svg?style=flat-square\n[docs-svg]: http://inch-ci.org/github/Emallates/gulp-task-builder.svg?branch=master\n[docs-url]: https://npmjs.org/package/gulp-task-builder/docs\n[package-url]: https://npmjs.org/package/gulp-task-builder\n[travis-url]: https://api.travis-ci.org/Emallates/gulp-task-builder.svg?branch=master\n[license-image]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\n[license-url]: LICENSE.txt\n[downloads-image]: https://img.shields.io/npm/dm/gulp-task-builder.svg?style=flat-square\n[downloads-url]: http://npm-stat.com/charts.html?package=gulp-task-builder\n\n\n[g-src-rf]: https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpsrcglobs-options\n[g-dest-rf]: https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpdestpath-options\n[g-watch-rf]: https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpwatchglob--opts-tasks-or-gulpwatchglob--opts-cb\n\n[g-filter-opts]: https://www.npmjs.com/package/gulp-filter#options\n[g-filter-api]: https://www.npmjs.com/package/gulp-filter#filterpattern-options\n[gulp-replace]: https://www.npmjs.com/package/gulp-replace\n\n[gulp-uglify]: https://www.npmjs.com/package/gulp-uglify\n[uglify-es]: https://www.npmjs.com/package/uglify-es\n[uglify-js-harmony]: https://www.npmjs.com/package/uglify-js-harmony\n\n[gulp-filter]: https://www.npmjs.com/package/gulp-filter\n[gulp-concat]: https://www.npmjs.com/package/gulp-concat\n[gulp-rename]: https://www.npmjs.com/package/gulp-rename\n[gulp-wrapper]: https://www.npmjs.com/package/gulp-wrapper\n[gulp-htmlmin]: https://www.npmjs.com/package/gulp-htmlmin\n[gulp-clean-css]: https://www.npmjs.com/package/gulp-clean-css\n[gulp-jsonminify]: https://www.npmjs.com/package/gulp-jsonminify\n[gulp-merge-json]: https://www.npmjs.com/package/gulp-merge-json\n[gulp-mincss-opts]: https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femallates%2Fgulp-task-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femallates%2Fgulp-task-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femallates%2Fgulp-task-builder/lists"}