{"action":"created","comment":{"url":"https://api.github.com/repos/gulpjs/gulp/pulls/comments/25562846","id":25562846,"diff_hunk":"@@ -104,132 +105,183 @@ gulp.task('somename', function() {\n \n #### name\n \n-The name of the task. Tasks that you want to run from the command line should not have spaces in them.\n+Optional, The name of the task. Tasks that you want to run from the command line \n+should not have spaces in them.\n \n-#### deps\n-Type: `Array`\n+If the name is not provided, the task will be name after the function `name` attribute.\n \n-An array of tasks to be executed and completed before your task will run.\n+Note that ES 6 `Function.name` is not writable. It cannot be set or edited:\n \n ```js\n-gulp.task('mytask', ['array', 'of', 'task', 'names'], function() {\n-  // Do stuff\n-});\n+// foo.name === 'foo'\n+function foo() {};\n+\n+// bar.name === ''\n+var bar = function() {};\n+\n+// bar.name === ''\n+bar.name = 'bar'\n ```\n \n-**Note:** Are your tasks running before the dependencies are complete?  Make sure your dependency tasks are correctly using the async run hints: take in a callback or return a promise or event stream.\n+You should either provide the task name or avoid anonymous functions.\n \n #### fn\n \n-The function that performs the task's operations. Generally this takes the form of `gulp.src().pipe(someplugin())`.\n+The function that performs the task's operations. \n+Generally this takes the form of `gulp.src().pipe(someplugin())`.\n \n #### Async task support\n \n Tasks can be made asynchronous if its `fn` does one of the following:\n \n-##### Accept a callback\n-\n-```javascript\n-// run a command in a shell\n-var exec = require('child_process').exec;\n-gulp.task('jekyll', function(cb) {\n-  // build Jekyll\n-  exec('jekyll build', function(err) {\n-    if (err) return cb(err); // return error\n-    cb(); // finished task\n-  });\n-});\n-```\n-\n ##### Return a stream\n \n ```js\n gulp.task('somename', function() {\n-  var stream = gulp.src('client/**/*.js')\n+  return gulp.src('client/**/*.js')\n     .pipe(minify())\n     .pipe(gulp.dest('build'));\n-  return stream;\n });\n ```\n \n-##### Return a promise\n+##### Accept a callback\n \n-```javascript\n-var Q = require('q');\n+```js\n+var del = require('del');\n \n-gulp.task('somename', function() {\n-  var deferred = Q.defer();\n+gulp.task('clean', function(done) {\n+  del(['.build/'], function(err) {\n+    done(err)\n+  });\n+  // or\n+  // del(['.build/'], done);\n+});\n+```\n \n-  // do async stuff\n-  setTimeout(function() {\n-    deferred.resolve();\n-  }, 1);\n+##### Return a promise\n \n-  return deferred.promise;\n+```js\n+var Promise = require('promise');\n+var del = require('del');\n+\n+gulp.task('clean', function() {\n+  return new Promise(function (resolve, reject) {\n+    del(['.build/'], function(err) {\n+      if (err) {\n+        reject(err);\n+      } else {\n+        resolve();\n+      }\n+    });\n+  });\n });\n ```\n \n-**Note:** By default, tasks run with maximum concurrency -- e.g. it launches all the tasks at once and waits for nothing. If you want to create a series where tasks run in a particular order, you need to do two things:\n+or:\n+```js\n+var promisedDel = require('promised-del');\n \n-- give it a hint to tell it when the task is done,\n-- and give it a hint that a task depends on completion of another.\n+gulp.task('clean', function() {\n+  return promisedDel(['.build/']);\n+});\n+```\n \n-For these examples, let's presume you have two tasks, \"one\" and \"two\" that you specifically want to run in this order:\n+##### Return a child process\n \n-1. In task \"one\" you add a hint to tell it when the task is done.  Either take in a callback and call it when you're\n-done or return a promise or stream that the engine should wait to resolve or end respectively.\n+```js\n+gulp.task('clean', function() {\n+  return spawn('rm', ['-rf', path.join(__dirname, 'build')]);\n+});\n \n-2. In task \"two\" you add a hint telling the engine that it depends on completion of the first task.\n+```\n \n-So this example would look like this:\n+**Note:** By default, tasks run with maximum concurrency -- e.g. it launches ","path":"docs/API.md","position":168,"original_position":168,"commit_id":"798ca30958da9c8443fb66f42779b3327a985bc6","original_commit_id":"09fd1d73d5b501136c9e2c8d0a21549b9c2067e4","user":{"login":"heikki","id":82735,"avatar_url":"https://avatars.githubusercontent.com/u/82735?v=3","gravatar_id":"","url":"https://api.github.com/users/heikki","html_url":"https://github.com/heikki","followers_url":"https://api.github.com/users/heikki/followers","following_url":"https://api.github.com/users/heikki/following{/other_user}","gists_url":"https://api.github.com/users/heikki/gists{/gist_id}","starred_url":"https://api.github.com/users/heikki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heikki/subscriptions","organizations_url":"https://api.github.com/users/heikki/orgs","repos_url":"https://api.github.com/users/heikki/repos","events_url":"https://api.github.com/users/heikki/events{/privacy}","received_events_url":"https://api.github.com/users/heikki/received_events","type":"User","site_admin":false},"body":"Is this note still valid?","created_at":"2015-03-01T00:41:09Z","updated_at":"2015-03-01T00:41:09Z","html_url":"https://github.com/gulpjs/gulp/pull/937#discussion_r25562846","pull_request_url":"https://api.github.com/repos/gulpjs/gulp/pulls/937","_links":{"self":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/comments/25562846"},"html":{"href":"https://github.com/gulpjs/gulp/pull/937#discussion_r25562846"},"pull_request":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/937"}}},"pull_request":{"url":"https://api.github.com/repos/gulpjs/gulp/pulls/937","id":30234029,"html_url":"https://github.com/gulpjs/gulp/pull/937","diff_url":"https://github.com/gulpjs/gulp/pull/937.diff","patch_url":"https://github.com/gulpjs/gulp/pull/937.patch","issue_url":"https://api.github.com/repos/gulpjs/gulp/issues/937","number":937,"state":"open","locked":false,"title":"Document the new gulp.task API.","user":{"login":"dinoboff","id":6830,"avatar_url":"https://avatars.githubusercontent.com/u/6830?v=3","gravatar_id":"","url":"https://api.github.com/users/dinoboff","html_url":"https://github.com/dinoboff","followers_url":"https://api.github.com/users/dinoboff/followers","following_url":"https://api.github.com/users/dinoboff/following{/other_user}","gists_url":"https://api.github.com/users/dinoboff/gists{/gist_id}","starred_url":"https://api.github.com/users/dinoboff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinoboff/subscriptions","organizations_url":"https://api.github.com/users/dinoboff/orgs","repos_url":"https://api.github.com/users/dinoboff/repos","events_url":"https://api.github.com/users/dinoboff/events{/privacy}","received_events_url":"https://api.github.com/users/dinoboff/received_events","type":"User","site_admin":false},"body":"Also add the gulp.series and gulp.parallel APIs.\r\n\r\n#803","created_at":"2015-03-01T00:27:17Z","updated_at":"2015-03-01T00:41:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afbdfa34996ea86148dc2b4cb130164644dd9bd5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gulpjs/gulp/pulls/937/commits","review_comments_url":"https://api.github.com/repos/gulpjs/gulp/pulls/937/comments","review_comment_url":"https://api.github.com/repos/gulpjs/gulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gulpjs/gulp/issues/937/comments","statuses_url":"https://api.github.com/repos/gulpjs/gulp/statuses/798ca30958da9c8443fb66f42779b3327a985bc6","head":{"label":"dinoboff:dinoboff-undertaker-doc","ref":"dinoboff-undertaker-doc","sha":"798ca30958da9c8443fb66f42779b3327a985bc6","user":{"login":"dinoboff","id":6830,"avatar_url":"https://avatars.githubusercontent.com/u/6830?v=3","gravatar_id":"","url":"https://api.github.com/users/dinoboff","html_url":"https://github.com/dinoboff","followers_url":"https://api.github.com/users/dinoboff/followers","following_url":"https://api.github.com/users/dinoboff/following{/other_user}","gists_url":"https://api.github.com/users/dinoboff/gists{/gist_id}","starred_url":"https://api.github.com/users/dinoboff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinoboff/subscriptions","organizations_url":"https://api.github.com/users/dinoboff/orgs","repos_url":"https://api.github.com/users/dinoboff/repos","events_url":"https://api.github.com/users/dinoboff/events{/privacy}","received_events_url":"https://api.github.com/users/dinoboff/received_events","type":"User","site_admin":false},"repo":{"id":31472855,"name":"gulp","full_name":"dinoboff/gulp","owner":{"login":"dinoboff","id":6830,"avatar_url":"https://avatars.githubusercontent.com/u/6830?v=3","gravatar_id":"","url":"https://api.github.com/users/dinoboff","html_url":"https://github.com/dinoboff","followers_url":"https://api.github.com/users/dinoboff/followers","following_url":"https://api.github.com/users/dinoboff/following{/other_user}","gists_url":"https://api.github.com/users/dinoboff/gists{/gist_id}","starred_url":"https://api.github.com/users/dinoboff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinoboff/subscriptions","organizations_url":"https://api.github.com/users/dinoboff/orgs","repos_url":"https://api.github.com/users/dinoboff/repos","events_url":"https://api.github.com/users/dinoboff/events{/privacy}","received_events_url":"https://api.github.com/users/dinoboff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dinoboff/gulp","description":"The streaming build system","fork":true,"url":"https://api.github.com/repos/dinoboff/gulp","forks_url":"https://api.github.com/repos/dinoboff/gulp/forks","keys_url":"https://api.github.com/repos/dinoboff/gulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinoboff/gulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinoboff/gulp/teams","hooks_url":"https://api.github.com/repos/dinoboff/gulp/hooks","issue_events_url":"https://api.github.com/repos/dinoboff/gulp/issues/events{/number}","events_url":"https://api.github.com/repos/dinoboff/gulp/events","assignees_url":"https://api.github.com/repos/dinoboff/gulp/assignees{/user}","branches_url":"https://api.github.com/repos/dinoboff/gulp/branches{/branch}","tags_url":"https://api.github.com/repos/dinoboff/gulp/tags","blobs_url":"https://api.github.com/repos/dinoboff/gulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinoboff/gulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinoboff/gulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinoboff/gulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinoboff/gulp/statuses/{sha}","languages_url":"https://api.github.com/repos/dinoboff/gulp/languages","stargazers_url":"https://api.github.com/repos/dinoboff/gulp/stargazers","contributors_url":"https://api.github.com/repos/dinoboff/gulp/contributors","subscribers_url":"https://api.github.com/repos/dinoboff/gulp/subscribers","subscription_url":"https://api.github.com/repos/dinoboff/gulp/subscription","commits_url":"https://api.github.com/repos/dinoboff/gulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinoboff/gulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinoboff/gulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinoboff/gulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dinoboff/gulp/contents/{+path}","compare_url":"https://api.github.com/repos/dinoboff/gulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinoboff/gulp/merges","archive_url":"https://api.github.com/repos/dinoboff/gulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinoboff/gulp/downloads","issues_url":"https://api.github.com/repos/dinoboff/gulp/issues{/number}","pulls_url":"https://api.github.com/repos/dinoboff/gulp/pulls{/number}","milestones_url":"https://api.github.com/repos/dinoboff/gulp/milestones{/number}","notifications_url":"https://api.github.com/repos/dinoboff/gulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinoboff/gulp/labels{/name}","releases_url":"https://api.github.com/repos/dinoboff/gulp/releases{/id}","created_at":"2015-02-28T19:01:37Z","updated_at":"2015-02-28T19:01:38Z","pushed_at":"2015-03-01T00:38:21Z","git_url":"git://github.com/dinoboff/gulp.git","ssh_url":"git@github.com:dinoboff/gulp.git","clone_url":"https://github.com/dinoboff/gulp.git","svn_url":"https://github.com/dinoboff/gulp","homepage":"http://gulpjs.com","size":3676,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gulpjs:4.0","ref":"4.0","sha":"0391f6612d58b0885f9df55c2085c5007600bcf9","user":{"login":"gulpjs","id":6200624,"avatar_url":"https://avatars.githubusercontent.com/u/6200624?v=3","gravatar_id":"","url":"https://api.github.com/users/gulpjs","html_url":"https://github.com/gulpjs","followers_url":"https://api.github.com/users/gulpjs/followers","following_url":"https://api.github.com/users/gulpjs/following{/other_user}","gists_url":"https://api.github.com/users/gulpjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gulpjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gulpjs/subscriptions","organizations_url":"https://api.github.com/users/gulpjs/orgs","repos_url":"https://api.github.com/users/gulpjs/repos","events_url":"https://api.github.com/users/gulpjs/events{/privacy}","received_events_url":"https://api.github.com/users/gulpjs/received_events","type":"Organization","site_admin":false},"repo":{"id":11167738,"name":"gulp","full_name":"gulpjs/gulp","owner":{"login":"gulpjs","id":6200624,"avatar_url":"https://avatars.githubusercontent.com/u/6200624?v=3","gravatar_id":"","url":"https://api.github.com/users/gulpjs","html_url":"https://github.com/gulpjs","followers_url":"https://api.github.com/users/gulpjs/followers","following_url":"https://api.github.com/users/gulpjs/following{/other_user}","gists_url":"https://api.github.com/users/gulpjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gulpjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gulpjs/subscriptions","organizations_url":"https://api.github.com/users/gulpjs/orgs","repos_url":"https://api.github.com/users/gulpjs/repos","events_url":"https://api.github.com/users/gulpjs/events{/privacy}","received_events_url":"https://api.github.com/users/gulpjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gulpjs/gulp","description":"The streaming build system","fork":false,"url":"https://api.github.com/repos/gulpjs/gulp","forks_url":"https://api.github.com/repos/gulpjs/gulp/forks","keys_url":"https://api.github.com/repos/gulpjs/gulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gulpjs/gulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gulpjs/gulp/teams","hooks_url":"https://api.github.com/repos/gulpjs/gulp/hooks","issue_events_url":"https://api.github.com/repos/gulpjs/gulp/issues/events{/number}","events_url":"https://api.github.com/repos/gulpjs/gulp/events","assignees_url":"https://api.github.com/repos/gulpjs/gulp/assignees{/user}","branches_url":"https://api.github.com/repos/gulpjs/gulp/branches{/branch}","tags_url":"https://api.github.com/repos/gulpjs/gulp/tags","blobs_url":"https://api.github.com/repos/gulpjs/gulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gulpjs/gulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gulpjs/gulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/gulpjs/gulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gulpjs/gulp/statuses/{sha}","languages_url":"https://api.github.com/repos/gulpjs/gulp/languages","stargazers_url":"https://api.github.com/repos/gulpjs/gulp/stargazers","contributors_url":"https://api.github.com/repos/gulpjs/gulp/contributors","subscribers_url":"https://api.github.com/repos/gulpjs/gulp/subscribers","subscription_url":"https://api.github.com/repos/gulpjs/gulp/subscription","commits_url":"https://api.github.com/repos/gulpjs/gulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/gulpjs/gulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/gulpjs/gulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/gulpjs/gulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/gulpjs/gulp/contents/{+path}","compare_url":"https://api.github.com/repos/gulpjs/gulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gulpjs/gulp/merges","archive_url":"https://api.github.com/repos/gulpjs/gulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gulpjs/gulp/downloads","issues_url":"https://api.github.com/repos/gulpjs/gulp/issues{/number}","pulls_url":"https://api.github.com/repos/gulpjs/gulp/pulls{/number}","milestones_url":"https://api.github.com/repos/gulpjs/gulp/milestones{/number}","notifications_url":"https://api.github.com/repos/gulpjs/gulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gulpjs/gulp/labels{/name}","releases_url":"https://api.github.com/repos/gulpjs/gulp/releases{/id}","created_at":"2013-07-04T05:26:06Z","updated_at":"2015-03-01T00:39:46Z","pushed_at":"2015-02-27T21:40:33Z","git_url":"git://github.com/gulpjs/gulp.git","ssh_url":"git@github.com:gulpjs/gulp.git","clone_url":"https://github.com/gulpjs/gulp.git","svn_url":"https://github.com/gulpjs/gulp","homepage":"http://gulpjs.com","size":3676,"stargazers_count":11969,"watchers_count":11969,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":934,"mirror_url":null,"open_issues_count":50,"forks":934,"open_issues":50,"watchers":11969,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/937"},"html":{"href":"https://github.com/gulpjs/gulp/pull/937"},"issue":{"href":"https://api.github.com/repos/gulpjs/gulp/issues/937"},"comments":{"href":"https://api.github.com/repos/gulpjs/gulp/issues/937/comments"},"review_comments":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/937/comments"},"review_comment":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gulpjs/gulp/pulls/937/commits"},"statuses":{"href":"https://api.github.com/repos/gulpjs/gulp/statuses/798ca30958da9c8443fb66f42779b3327a985bc6"}}}}