{"action":"created","issue":{"url":"https://api.github.com/repos/sillero/registry-resolve/issues/1","repository_url":"https://api.github.com/repos/sillero/registry-resolve","labels_url":"https://api.github.com/repos/sillero/registry-resolve/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sillero/registry-resolve/issues/1/comments","events_url":"https://api.github.com/repos/sillero/registry-resolve/issues/1/events","html_url":"https://github.com/sillero/registry-resolve/issues/1","id":171301682,"number":1,"title":"Enhancement: skip network requests for exact versions","user":{"login":"wmhilton","id":587740,"avatar_url":"https://avatars.githubusercontent.com/u/587740?v=3","gravatar_id":"","url":"https://api.github.com/users/wmhilton","html_url":"https://github.com/wmhilton","followers_url":"https://api.github.com/users/wmhilton/followers","following_url":"https://api.github.com/users/wmhilton/following{/other_user}","gists_url":"https://api.github.com/users/wmhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmhilton/subscriptions","organizations_url":"https://api.github.com/users/wmhilton/orgs","repos_url":"https://api.github.com/users/wmhilton/repos","events_url":"https://api.github.com/users/wmhilton/events{/privacy}","received_events_url":"https://api.github.com/users/wmhilton/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-16T01:38:07Z","updated_at":"2016-08-28T05:53:46Z","closed_at":"2016-08-28T05:53:46Z","body":"I'm implementing this in my project, but I can make a pull request if you want to support it in this module. I'm checking if the version given is exact, because we can skip making a network request if version is not a range.\r\n\r\nA lazy copy and paste of my code segment:\r\n```js\r\n  ...\r\n  // Bail if invalid semver\r\n  if (!semver.validRange(info.version)) {\r\n    throw Error `${info.name}: Invalid semver range: ${info.version}`\r\n  }\r\n  // For exact versions, just parse and normalize it.\r\n  if (semver.valid(info.version)) {\r\n    info.exact_version = semver.parse(info.version).version\r\n  // For version ranges, we need to do a network request to resolve\r\n  } else {\r\n    info.exact_version = yield resolve({\r\n      name: info.name,\r\n      version: info.version,\r\n      registry: 'http://registry.node-modules.io'\r\n    })\r\n  }\r\n  ...\r\n```"},"comment":{"url":"https://api.github.com/repos/sillero/registry-resolve/issues/comments/242957974","html_url":"https://github.com/sillero/registry-resolve/issues/1#issuecomment-242957974","issue_url":"https://api.github.com/repos/sillero/registry-resolve/issues/1","id":242957974,"user":{"login":"wmhilton","id":587740,"avatar_url":"https://avatars.githubusercontent.com/u/587740?v=3","gravatar_id":"","url":"https://api.github.com/users/wmhilton","html_url":"https://github.com/wmhilton","followers_url":"https://api.github.com/users/wmhilton/followers","following_url":"https://api.github.com/users/wmhilton/following{/other_user}","gists_url":"https://api.github.com/users/wmhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmhilton/subscriptions","organizations_url":"https://api.github.com/users/wmhilton/orgs","repos_url":"https://api.github.com/users/wmhilton/repos","events_url":"https://api.github.com/users/wmhilton/events{/privacy}","received_events_url":"https://api.github.com/users/wmhilton/received_events","type":"User","site_admin":false},"created_at":"2016-08-28T05:53:46Z","updated_at":"2016-08-28T05:53:46Z","body":"I rescind this suggestion, because it turns out I need that network request anyway, and instead have made a pull request that if accepted will cut my number of network requests in half."}}
{"actor":{"display_login":"wmhilton"}}