{"id":19560619,"url":"https://github.com/zoubin/gulp-task-directory","last_synced_at":"2025-02-26T08:41:46.003Z","repository":{"id":57259226,"uuid":"38038481","full_name":"zoubin/gulp-task-directory","owner":"zoubin","description":"build gulp task according to directory structure","archived":false,"fork":false,"pushed_at":"2015-06-26T07:25:55.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T18:39:22.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.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":"2015-06-25T08:46:52.000Z","updated_at":"2018-02-08T02:49:46.000Z","dependencies_parsed_at":"2022-08-25T03:01:58.240Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/gulp-task-directory","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-task-directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-task-directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-task-directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-task-directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/gulp-task-directory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240822615,"owners_count":19863302,"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-11T05:08:17.243Z","updated_at":"2025-02-26T08:41:45.941Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","readme":"# gulp-task-directory\nCreate gulp task according to directory or object structure\n\n## Usage\n\n```javascript\nvar taskDir = require('gulp-task-directory');\nvar gulp = require('gulp');\nvar plugins = require('gulp-load-plugins')();\nvar root = __dirname;\n\ntaskDir(__dirname + '/default', gulp, plugins, root);\n\nconsole.log(gulp.tasks);\n```\n\n### Structure of `default` directory\n\n```\n⌘ tree example/default\nexample/default\n├── 1\n│   └── default.js\n├── 2\n│   └── 3\n│       └── default.js\n├── 4\n│   └── default.js\n└── default.js\n```\n\n### Contents of all `default.js` files\n\n```javascript\nmodule.exports = function (gulp, plugins, root) {\n    return function (done) {\n        done()\n    }\n}\n```\n\n### output\n\n```javascript\n⌘ node example/default.js\n{ '1': { fn: [Function], dep: [], name: '1' },\n  '4': { fn: [Function], dep: [], name: '4' },\n  '2/3': { fn: [Function], dep: [], name: '2/3' },\n  default: { fn: [Function], dep: [], name: 'default' } }\n```\n\n## Specify deps\n\nIn `default.js`, you can specify more than one tasks, with dependencies.\n\nHowever, all dependencies must be tasks specified in the current `default.js`.\n\n```javascript\nvar taskDir = require('gulp-task-directory');\nvar gulp = require('gulp');\n\ntaskDir(__dirname + '/deps', gulp);\n\nconsole.log(gulp.tasks);\n```\n\n### Structure of `deps` directory\n\n```\n⌘ tree example/deps\nexample/deps\n├── 4\n│   └── default.js\n└── default.js\n```\n\n### Contents of `4/default.js`\n\n```javascript\nmodule.exports = function (gulp) {\n    return function (done) {\n        done()\n    }\n}\n```\n\n### Contents of `default.js`\n\n* It returns an object rather than a task callback.\n* Each key-value specifies a task.\n* Task `2` says it depedends on task `3` and `4`, but `4` is not specifed in this `default.js`, so it will be ignored, and the `dep` of task `2` will be `['3']`\n* Dependencies are specified using keys of the returned object.\n\n\n```javascript\nmodule.exports = function (gulp) {\n    return {\n        default: [[1]],\n        1: [[2,3], dummy],\n        2: [[3,4], dummy],\n        3: dummy,\n    }\n}\n\nfunction dummy(done) {\n    done()\n}\n```\n\n### Output\n\n```\n⌘ node example/deps.js\n{ '1': { fn: [Function: dummy], dep: [ '2', '3' ], name: '1' },\n  '2': { fn: [Function: dummy], dep: [ '3' ], name: '2' },\n  '3': { fn: [Function: dummy], dep: [], name: '3' },\n  '4': { fn: [Function], dep: [], name: '4' },\n  default: { fn: [Function], dep: [ '1' ], name: 'default' } }\n```\n\n## taskDir(dir, gulp, xarg1, xarg2,...)\n\n* `dir`. Each `default.js` in `dir` will be treated as a task creator, which should return either a callback, or an object specifying gulp tasks through key-value.\n* `gulp`. The `gulp` instance\n* `xarg1,xarg2,...`. All creator functions will be called using `gulp, xarg1, xarg2, ...`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgulp-task-directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fgulp-task-directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgulp-task-directory/lists"}