{"action":"created","issue":{"url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/4","labels_url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/4/comments","events_url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/4/events","html_url":"https://github.com/nodesecurity/nsp-api/pull/4","id":109698763,"number":4,"title":"Implementation of http(s) proxy support","user":{"login":"gabemarshall","id":2541585,"avatar_url":"https://avatars.githubusercontent.com/u/2541585?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemarshall","html_url":"https://github.com/gabemarshall","followers_url":"https://api.github.com/users/gabemarshall/followers","following_url":"https://api.github.com/users/gabemarshall/following{/other_user}","gists_url":"https://api.github.com/users/gabemarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemarshall/subscriptions","organizations_url":"https://api.github.com/users/gabemarshall/orgs","repos_url":"https://api.github.com/users/gabemarshall/repos","events_url":"https://api.github.com/users/gabemarshall/events{/privacy}","received_events_url":"https://api.github.com/users/gabemarshall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-04T19:15:31Z","updated_at":"2015-10-05T18:07:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodesecurity/nsp-api/pulls/4","html_url":"https://github.com/nodesecurity/nsp-api/pull/4","diff_url":"https://github.com/nodesecurity/nsp-api/pull/4.diff","patch_url":"https://github.com/nodesecurity/nsp-api/pull/4.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/comments/145617613","html_url":"https://github.com/nodesecurity/nsp-api/pull/4#issuecomment-145617613","issue_url":"https://api.github.com/repos/nodesecurity/nsp-api/issues/4","id":145617613,"user":{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T18:07:10Z","updated_at":"2015-10-05T18:07:10Z","body":"@gabemarshall,\r\n\r\nRe: backwards compat, I think you may just want to do some type sniffing and argument shifting.\r\n\r\nMaybe something like this:\r\n\r\n```js\r\nexports.validateModule = function(module, version, proxy, cb) {\r\n  if (typeof proxy === 'function') {\r\n    cb = proxy;\r\n    proxy = null;\r\n  }\r\n  // ...\r\n```\r\n\r\nThat way if somebody passes a function as the third argument (`proxy` in this code, but `cb` in the previous method signature) then you'd shift the callback to the fourth argument and set the `proxy` to `null`). That should give you backwards API compatibility, while still allowing for an optional argument in the middle of a method signature)."}}