{"action":"created","comment":{"url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/comments/173365163","pull_request_review_id":102544422,"id":173365163,"diff_hunk":"@@ -192,27 +192,39 @@ In the event that the file does not have an extension or the extension is unreco\n \n ### Instance methods (on `explorer`)\n \n-#### `search([searchPath])`\n+#### `search([searchPath][, searchOptions])`\n+\n \n Searches for a configuration file. Returns a Promise that resolves with `null`, if nothing is found, or an object with two properties:\n - `config`: The loaded and parsed configuration.\n - `filepath`: The filepath where this configuration was found.\n \n+When the [search option](#searchoptions) `ignoreEmpty` is set to false and an empty configuration file is found, the result will have `config` set to undefined and an additional property `isEmpty` set to true.\n+\n ```js\n explorer.search() // searches from process.cwd()\n explorer.search('start/search/here');\n explorer.search('start/search/at/this/file.css');\n+\n+// will stop on an empty configuration file\n+explorer.search('start/search/here', { ignoreEmpty: false })\n ```\n \n If you provide `searchPath`, cosmiconfig will start its search at `searchPath` and continue to search up the directory tree, as documented above.\n By default, `searchPath` is set to `process.cwd()`.\n \n+##### searchOptions\n+- Can be an object containing a single property `ignoreEmpty`.  This defaults to true and tells cosmiconfig whether to continue searching\n+for files when an empty one is found.\n+\n #### `load([configPath])`\n \n Loads a configuration file directly.  Rejects with an error if the file does not exist, if the file contents are empty, or if the file cannot be parsed.  Upon success it returns a Promise that resolves with an object with two properties:\n - `config`: The loaded and parsed configuration.\n - `filepath`: The filepath where this configuration was found.\n \n+If the file is empty then `config` will be set to undefined and an additional property `isEmpty` will be set to true","path":"README.md","position":35,"original_position":36,"commit_id":"1a9a26fa8708259cccefff7a2ebfe0001a2d229c","original_commit_id":"f52bf41c27df7b4891125c3b06f569a93791bfa0","user":{"login":"olsonpm","id":5957709,"avatar_url":"https://avatars2.githubusercontent.com/u/5957709?v=4","gravatar_id":"","url":"https://api.github.com/users/olsonpm","html_url":"https://github.com/olsonpm","followers_url":"https://api.github.com/users/olsonpm/followers","following_url":"https://api.github.com/users/olsonpm/following{/other_user}","gists_url":"https://api.github.com/users/olsonpm/gists{/gist_id}","starred_url":"https://api.github.com/users/olsonpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olsonpm/subscriptions","organizations_url":"https://api.github.com/users/olsonpm/orgs","repos_url":"https://api.github.com/users/olsonpm/repos","events_url":"https://api.github.com/users/olsonpm/events{/privacy}","received_events_url":"https://api.github.com/users/olsonpm/received_events","type":"User","site_admin":false},"body":"whoops - I think I only got the one by the searchOptions.  Didn't realize there were two","created_at":"2018-03-09T04:52:08Z","updated_at":"2018-03-09T04:52:08Z","html_url":"https://github.com/davidtheclark/cosmiconfig/pull/107#discussion_r173365163","pull_request_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/comments/173365163"},"html":{"href":"https://github.com/davidtheclark/cosmiconfig/pull/107#discussion_r173365163"},"pull_request":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107"}},"in_reply_to_id":173060710},"pull_request":{"url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107","id":168111063,"html_url":"https://github.com/davidtheclark/cosmiconfig/pull/107","diff_url":"https://github.com/davidtheclark/cosmiconfig/pull/107.diff","patch_url":"https://github.com/davidtheclark/cosmiconfig/pull/107.patch","issue_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/107","number":107,"state":"open","locked":false,"title":"Treat empty files differently from non-existent","user":{"login":"olsonpm","id":5957709,"avatar_url":"https://avatars2.githubusercontent.com/u/5957709?v=4","gravatar_id":"","url":"https://api.github.com/users/olsonpm","html_url":"https://github.com/olsonpm","followers_url":"https://api.github.com/users/olsonpm/followers","following_url":"https://api.github.com/users/olsonpm/following{/other_user}","gists_url":"https://api.github.com/users/olsonpm/gists{/gist_id}","starred_url":"https://api.github.com/users/olsonpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olsonpm/subscriptions","organizations_url":"https://api.github.com/users/olsonpm/orgs","repos_url":"https://api.github.com/users/olsonpm/repos","events_url":"https://api.github.com/users/olsonpm/events{/privacy}","received_events_url":"https://api.github.com/users/olsonpm/received_events","type":"User","site_admin":false},"body":"- Return an 'undefined' config along with the file path for empty\r\n  configuration files when both traversing directories and loading\r\n  defined files.  Previously empty configuration files would prompt\r\n  an error upon loading defined files and be silently passed over\r\n  during directory traversal.\r\n\r\nBREAKING CHANGE: treats empty files differently","created_at":"2018-02-08T23:00:43Z","updated_at":"2018-03-09T04:52:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"878c2edb0dc86be58057de0524fcdb14664756bf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107/commits","review_comments_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107/comments","review_comment_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/107/comments","statuses_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/statuses/1a9a26fa8708259cccefff7a2ebfe0001a2d229c","head":{"label":"olsonpm:return-undefined-upon-empty-config","ref":"return-undefined-upon-empty-config","sha":"1a9a26fa8708259cccefff7a2ebfe0001a2d229c","user":{"login":"olsonpm","id":5957709,"avatar_url":"https://avatars2.githubusercontent.com/u/5957709?v=4","gravatar_id":"","url":"https://api.github.com/users/olsonpm","html_url":"https://github.com/olsonpm","followers_url":"https://api.github.com/users/olsonpm/followers","following_url":"https://api.github.com/users/olsonpm/following{/other_user}","gists_url":"https://api.github.com/users/olsonpm/gists{/gist_id}","starred_url":"https://api.github.com/users/olsonpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olsonpm/subscriptions","organizations_url":"https://api.github.com/users/olsonpm/orgs","repos_url":"https://api.github.com/users/olsonpm/repos","events_url":"https://api.github.com/users/olsonpm/events{/privacy}","received_events_url":"https://api.github.com/users/olsonpm/received_events","type":"User","site_admin":false},"repo":{"id":120809768,"name":"cosmiconfig","full_name":"olsonpm/cosmiconfig","owner":{"login":"olsonpm","id":5957709,"avatar_url":"https://avatars2.githubusercontent.com/u/5957709?v=4","gravatar_id":"","url":"https://api.github.com/users/olsonpm","html_url":"https://github.com/olsonpm","followers_url":"https://api.github.com/users/olsonpm/followers","following_url":"https://api.github.com/users/olsonpm/following{/other_user}","gists_url":"https://api.github.com/users/olsonpm/gists{/gist_id}","starred_url":"https://api.github.com/users/olsonpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olsonpm/subscriptions","organizations_url":"https://api.github.com/users/olsonpm/orgs","repos_url":"https://api.github.com/users/olsonpm/repos","events_url":"https://api.github.com/users/olsonpm/events{/privacy}","received_events_url":"https://api.github.com/users/olsonpm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olsonpm/cosmiconfig","description":"Find and load configuration from a package.json property, rc file, or CommonJS module","fork":true,"url":"https://api.github.com/repos/olsonpm/cosmiconfig","forks_url":"https://api.github.com/repos/olsonpm/cosmiconfig/forks","keys_url":"https://api.github.com/repos/olsonpm/cosmiconfig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olsonpm/cosmiconfig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olsonpm/cosmiconfig/teams","hooks_url":"https://api.github.com/repos/olsonpm/cosmiconfig/hooks","issue_events_url":"https://api.github.com/repos/olsonpm/cosmiconfig/issues/events{/number}","events_url":"https://api.github.com/repos/olsonpm/cosmiconfig/events","assignees_url":"https://api.github.com/repos/olsonpm/cosmiconfig/assignees{/user}","branches_url":"https://api.github.com/repos/olsonpm/cosmiconfig/branches{/branch}","tags_url":"https://api.github.com/repos/olsonpm/cosmiconfig/tags","blobs_url":"https://api.github.com/repos/olsonpm/cosmiconfig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olsonpm/cosmiconfig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olsonpm/cosmiconfig/git/refs{/sha}","trees_url":"https://api.github.com/repos/olsonpm/cosmiconfig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olsonpm/cosmiconfig/statuses/{sha}","languages_url":"https://api.github.com/repos/olsonpm/cosmiconfig/languages","stargazers_url":"https://api.github.com/repos/olsonpm/cosmiconfig/stargazers","contributors_url":"https://api.github.com/repos/olsonpm/cosmiconfig/contributors","subscribers_url":"https://api.github.com/repos/olsonpm/cosmiconfig/subscribers","subscription_url":"https://api.github.com/repos/olsonpm/cosmiconfig/subscription","commits_url":"https://api.github.com/repos/olsonpm/cosmiconfig/commits{/sha}","git_commits_url":"https://api.github.com/repos/olsonpm/cosmiconfig/git/commits{/sha}","comments_url":"https://api.github.com/repos/olsonpm/cosmiconfig/comments{/number}","issue_comment_url":"https://api.github.com/repos/olsonpm/cosmiconfig/issues/comments{/number}","contents_url":"https://api.github.com/repos/olsonpm/cosmiconfig/contents/{+path}","compare_url":"https://api.github.com/repos/olsonpm/cosmiconfig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olsonpm/cosmiconfig/merges","archive_url":"https://api.github.com/repos/olsonpm/cosmiconfig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olsonpm/cosmiconfig/downloads","issues_url":"https://api.github.com/repos/olsonpm/cosmiconfig/issues{/number}","pulls_url":"https://api.github.com/repos/olsonpm/cosmiconfig/pulls{/number}","milestones_url":"https://api.github.com/repos/olsonpm/cosmiconfig/milestones{/number}","notifications_url":"https://api.github.com/repos/olsonpm/cosmiconfig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olsonpm/cosmiconfig/labels{/name}","releases_url":"https://api.github.com/repos/olsonpm/cosmiconfig/releases{/id}","deployments_url":"https://api.github.com/repos/olsonpm/cosmiconfig/deployments","created_at":"2018-02-08T19:49:19Z","updated_at":"2018-02-08T19:49:21Z","pushed_at":"2018-03-08T20:07:42Z","git_url":"git://github.com/olsonpm/cosmiconfig.git","ssh_url":"git@github.com:olsonpm/cosmiconfig.git","clone_url":"https://github.com/olsonpm/cosmiconfig.git","svn_url":"https://github.com/olsonpm/cosmiconfig","homepage":"","size":360,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"davidtheclark:master","ref":"master","sha":"44a65ab84dd223b231e55e6e3752b8736564d872","user":{"login":"davidtheclark","id":628431,"avatar_url":"https://avatars2.githubusercontent.com/u/628431?v=4","gravatar_id":"","url":"https://api.github.com/users/davidtheclark","html_url":"https://github.com/davidtheclark","followers_url":"https://api.github.com/users/davidtheclark/followers","following_url":"https://api.github.com/users/davidtheclark/following{/other_user}","gists_url":"https://api.github.com/users/davidtheclark/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtheclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtheclark/subscriptions","organizations_url":"https://api.github.com/users/davidtheclark/orgs","repos_url":"https://api.github.com/users/davidtheclark/repos","events_url":"https://api.github.com/users/davidtheclark/events{/privacy}","received_events_url":"https://api.github.com/users/davidtheclark/received_events","type":"User","site_admin":false},"repo":{"id":45750507,"name":"cosmiconfig","full_name":"davidtheclark/cosmiconfig","owner":{"login":"davidtheclark","id":628431,"avatar_url":"https://avatars2.githubusercontent.com/u/628431?v=4","gravatar_id":"","url":"https://api.github.com/users/davidtheclark","html_url":"https://github.com/davidtheclark","followers_url":"https://api.github.com/users/davidtheclark/followers","following_url":"https://api.github.com/users/davidtheclark/following{/other_user}","gists_url":"https://api.github.com/users/davidtheclark/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtheclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtheclark/subscriptions","organizations_url":"https://api.github.com/users/davidtheclark/orgs","repos_url":"https://api.github.com/users/davidtheclark/repos","events_url":"https://api.github.com/users/davidtheclark/events{/privacy}","received_events_url":"https://api.github.com/users/davidtheclark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidtheclark/cosmiconfig","description":"Find and load configuration from a package.json property, rc file, or CommonJS module","fork":false,"url":"https://api.github.com/repos/davidtheclark/cosmiconfig","forks_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/forks","keys_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/teams","hooks_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/hooks","issue_events_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/events{/number}","events_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/events","assignees_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/assignees{/user}","branches_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/branches{/branch}","tags_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/tags","blobs_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/statuses/{sha}","languages_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/languages","stargazers_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/stargazers","contributors_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/contributors","subscribers_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/subscribers","subscription_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/subscription","commits_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/contents/{+path}","compare_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/merges","archive_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/downloads","issues_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues{/number}","pulls_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls{/number}","milestones_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/milestones{/number}","notifications_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/labels{/name}","releases_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/releases{/id}","deployments_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/deployments","created_at":"2015-11-07T19:12:10Z","updated_at":"2018-03-08T12:46:45Z","pushed_at":"2018-03-08T20:07:44Z","git_url":"git://github.com/davidtheclark/cosmiconfig.git","ssh_url":"git@github.com:davidtheclark/cosmiconfig.git","clone_url":"https://github.com/davidtheclark/cosmiconfig.git","svn_url":"https://github.com/davidtheclark/cosmiconfig","homepage":"","size":338,"stargazers_count":613,"watchers_count":613,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":48,"open_issues":8,"watchers":613,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107"},"html":{"href":"https://github.com/davidtheclark/cosmiconfig/pull/107"},"issue":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/107"},"comments":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/davidtheclark/cosmiconfig/statuses/1a9a26fa8708259cccefff7a2ebfe0001a2d229c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"olsonpm"}}