{"action":"created","issue":{"url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/49","repository_url":"https://api.github.com/repos/davidtheclark/cosmiconfig","labels_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/49/comments","events_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/49/events","html_url":"https://github.com/davidtheclark/cosmiconfig/issues/49","id":197518891,"number":49,"title":"Silently failing","user":{"login":"CrashyBang","id":2978850,"avatar_url":"https://avatars.githubusercontent.com/u/2978850?v=3","gravatar_id":"","url":"https://api.github.com/users/CrashyBang","html_url":"https://github.com/CrashyBang","followers_url":"https://api.github.com/users/CrashyBang/followers","following_url":"https://api.github.com/users/CrashyBang/following{/other_user}","gists_url":"https://api.github.com/users/CrashyBang/gists{/gist_id}","starred_url":"https://api.github.com/users/CrashyBang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrashyBang/subscriptions","organizations_url":"https://api.github.com/users/CrashyBang/orgs","repos_url":"https://api.github.com/users/CrashyBang/repos","events_url":"https://api.github.com/users/CrashyBang/events{/privacy}","received_events_url":"https://api.github.com/users/CrashyBang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-25T23:29:41Z","updated_at":"2016-12-26T21:24:02Z","closed_at":null,"body":"I have the following code block:\r\n\r\n```js\r\nconst config = require('cosmiconfig');\r\n\r\nconst flatten = (key, source, rules) => {\r\n    config('weblo')\r\n        .load(null, `${process.cwd()}/package.json`)\r\n        .then(result => {\r\n            // Never hit\r\n           console.log('hit');\r\n        }).catch(err => {\r\n            // Also never hit\r\n            console.log(err);\r\n        });\r\n\r\n    // Hit straight away\r\n    console.log( 'end');\r\n\r\n};\r\n\r\nmodule.exports = flatten;\r\n```\r\n\r\nIf I pass anything invalid to `load()` it falls over, I have also tried passing nothing through, passing just `process.cwd()` through but ideally I do just want to read from the `package.json` hence trying to load the `configPath` as opposed to the `searchPath`. I have tried debugging but with silent output there is not too much I can do.\r\n\r\nSorry JS skills are a little limited so can't provide much more info.\r\n\r\nCheers."},"comment":{"url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/comments/269242716","html_url":"https://github.com/davidtheclark/cosmiconfig/issues/49#issuecomment-269242716","issue_url":"https://api.github.com/repos/davidtheclark/cosmiconfig/issues/49","id":269242716,"user":{"login":"davidtheclark","id":628431,"avatar_url":"https://avatars.githubusercontent.com/u/628431?v=3","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},"created_at":"2016-12-26T21:24:02Z","updated_at":"2016-12-26T21:24:02Z","body":"@CrashyBang What if you set the cosmiconfig options `rc: false, js: false`, then set the `searchPath` argument to `process.cwd()`? That way the only thing cosmiconfig will look for in the current working directory is `package.json`.\r\n\r\nRight now I do not think there is not a way to specify a `package.json` as the `configPath`. PR welcome, though!"}}
{"actor":{"display_login":"davidtheclark"}}