{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/pify/pulls/comments/42687589","id":42687589,"diff_hunk":"@@ -32,24 +25,31 @@ var pify = module.exports = function (fn, P, opts) {\n \t};\n };\n \n-pify.all = function (obj, P, opts) {\n+var pify = module.exports = function (obj, P, opts) {\n \tif (typeof P !== 'function') {\n \t\topts = P;\n \t\tP = Promise;\n \t}\n \n \topts = opts || {};\n+\topts.exclude = opts.exclude || [/^.+Sync$/];\n \n \tvar filter = function (key) {\n-\t\tif (opts.include) {\n-\t\t\treturn opts.include.indexOf(key) !== -1;\n-\t\t}\n+\t\tvar check = function (patterns) {\n+\t\t\tfor (var i = 0; i < patterns.length; i++) {","path":"index.js","position":34,"original_position":34,"commit_id":"bf3e3d13516222cfcec9fab7bbb292e5f1fa7498","original_commit_id":"bf3e3d13516222cfcec9fab7bbb292e5f1fa7498","user":{"login":"dsblv","id":1024980,"avatar_url":"https://avatars.githubusercontent.com/u/1024980?v=3","gravatar_id":"","url":"https://api.github.com/users/dsblv","html_url":"https://github.com/dsblv","followers_url":"https://api.github.com/users/dsblv/followers","following_url":"https://api.github.com/users/dsblv/following{/other_user}","gists_url":"https://api.github.com/users/dsblv/gists{/gist_id}","starred_url":"https://api.github.com/users/dsblv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsblv/subscriptions","organizations_url":"https://api.github.com/users/dsblv/orgs","repos_url":"https://api.github.com/users/dsblv/repos","events_url":"https://api.github.com/users/dsblv/events{/privacy}","received_events_url":"https://api.github.com/users/dsblv/received_events","type":"User","site_admin":false},"body":"Cool! :muscle:","created_at":"2015-10-21T21:51:08Z","updated_at":"2015-10-21T21:51:08Z","html_url":"https://github.com/sindresorhus/pify/pull/10#discussion_r42687589","pull_request_url":"https://api.github.com/repos/sindresorhus/pify/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/comments/42687589"},"html":{"href":"https://github.com/sindresorhus/pify/pull/10#discussion_r42687589"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/pify/pulls/10","id":44852820,"html_url":"https://github.com/sindresorhus/pify/pull/10","diff_url":"https://github.com/sindresorhus/pify/pull/10.diff","patch_url":"https://github.com/sindresorhus/pify/pull/10.patch","issue_url":"https://api.github.com/repos/sindresorhus/pify/issues/10","number":10,"state":"open","locked":false,"title":"Glob method matching","user":{"login":"dsblv","id":1024980,"avatar_url":"https://avatars.githubusercontent.com/u/1024980?v=3","gravatar_id":"","url":"https://api.github.com/users/dsblv","html_url":"https://github.com/dsblv","followers_url":"https://api.github.com/users/dsblv/followers","following_url":"https://api.github.com/users/dsblv/following{/other_user}","gists_url":"https://api.github.com/users/dsblv/gists{/gist_id}","starred_url":"https://api.github.com/users/dsblv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsblv/subscriptions","organizations_url":"https://api.github.com/users/dsblv/orgs","repos_url":"https://api.github.com/users/dsblv/repos","events_url":"https://api.github.com/users/dsblv/events{/privacy}","received_events_url":"https://api.github.com/users/dsblv/received_events","type":"User","site_admin":false},"body":"I thought it would be handy if we could pick methods to promisify using **globs**. This way we can drop `opts.exclude` while being able to do this:\r\n\r\n```js\r\nconst fs = require('fs');\r\nconst pify = require('pify');\r\n\r\nconst pfs = pify(fs, {include: ['write*', '!*Sync']});\r\n```\r\n\r\nIt adds one dependency to pify – [multimatch](https://github.com/sindresorhus/multimatch) – which is quite small.\r\n\r\nI also realized today that `pify.all()` can do the same thing as `pify()` so we are able to simplify the API back to one single function! I did that and tested with existing test and it all worked.\r\n\r\n---\r\n\r\nFor compatibility I left `pify.all` as an alias for `pify` and added this code:\r\n\r\n```js\r\nif (opts.exclude && !opts.include) {\r\n\topts.include = opts.exclude.map(function (glob) {\r\n\t\treturn '!' + glob;\r\n\t});\r\n}\r\n```\r\n\r\n... to keep `opts.exclude` working.","created_at":"2015-09-12T12:48:27Z","updated_at":"2015-10-21T21:51:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2652179a195b0e1d1acfab381111830178b45007","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/pify/pulls/10/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/pify/pulls/10/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/pify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/pify/issues/10/comments","statuses_url":"https://api.github.com/repos/sindresorhus/pify/statuses/bf3e3d13516222cfcec9fab7bbb292e5f1fa7498","head":{"label":"sindresorhus:glob-method-matching","ref":"glob-method-matching","sha":"bf3e3d13516222cfcec9fab7bbb292e5f1fa7498","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":41585934,"name":"pify","full_name":"sindresorhus/pify","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/pify","description":"Promisify a callback-style function","fork":false,"url":"https://api.github.com/repos/sindresorhus/pify","forks_url":"https://api.github.com/repos/sindresorhus/pify/forks","keys_url":"https://api.github.com/repos/sindresorhus/pify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/pify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/pify/teams","hooks_url":"https://api.github.com/repos/sindresorhus/pify/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/pify/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/pify/events","assignees_url":"https://api.github.com/repos/sindresorhus/pify/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/pify/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/pify/tags","blobs_url":"https://api.github.com/repos/sindresorhus/pify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/pify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/pify/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/pify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/pify/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/pify/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/pify/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/pify/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/pify/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/pify/subscription","commits_url":"https://api.github.com/repos/sindresorhus/pify/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/pify/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/pify/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/pify/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/pify/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/pify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/pify/merges","archive_url":"https://api.github.com/repos/sindresorhus/pify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/pify/downloads","issues_url":"https://api.github.com/repos/sindresorhus/pify/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/pify/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/pify/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/pify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/pify/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/pify/releases{/id}","created_at":"2015-08-29T08:13:07Z","updated_at":"2015-10-21T21:47:27Z","pushed_at":"2015-10-20T15:18:28Z","git_url":"git://github.com/sindresorhus/pify.git","ssh_url":"git@github.com:sindresorhus/pify.git","clone_url":"https://github.com/sindresorhus/pify.git","svn_url":"https://github.com/sindresorhus/pify","homepage":null,"size":207,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":73,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"665ffa9dcac562c59187279b0220300aa21740b0","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":41585934,"name":"pify","full_name":"sindresorhus/pify","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/pify","description":"Promisify a callback-style function","fork":false,"url":"https://api.github.com/repos/sindresorhus/pify","forks_url":"https://api.github.com/repos/sindresorhus/pify/forks","keys_url":"https://api.github.com/repos/sindresorhus/pify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/pify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/pify/teams","hooks_url":"https://api.github.com/repos/sindresorhus/pify/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/pify/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/pify/events","assignees_url":"https://api.github.com/repos/sindresorhus/pify/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/pify/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/pify/tags","blobs_url":"https://api.github.com/repos/sindresorhus/pify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/pify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/pify/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/pify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/pify/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/pify/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/pify/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/pify/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/pify/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/pify/subscription","commits_url":"https://api.github.com/repos/sindresorhus/pify/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/pify/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/pify/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/pify/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/pify/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/pify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/pify/merges","archive_url":"https://api.github.com/repos/sindresorhus/pify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/pify/downloads","issues_url":"https://api.github.com/repos/sindresorhus/pify/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/pify/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/pify/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/pify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/pify/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/pify/releases{/id}","created_at":"2015-08-29T08:13:07Z","updated_at":"2015-10-21T21:47:27Z","pushed_at":"2015-10-20T15:18:28Z","git_url":"git://github.com/sindresorhus/pify.git","ssh_url":"git@github.com:sindresorhus/pify.git","clone_url":"https://github.com/sindresorhus/pify.git","svn_url":"https://github.com/sindresorhus/pify","homepage":null,"size":207,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/10"},"html":{"href":"https://github.com/sindresorhus/pify/pull/10"},"issue":{"href":"https://api.github.com/repos/sindresorhus/pify/issues/10"},"comments":{"href":"https://api.github.com/repos/sindresorhus/pify/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/pify/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/pify/statuses/bf3e3d13516222cfcec9fab7bbb292e5f1fa7498"}}}}