{"action":"created","comment":{"url":"https://api.github.com/repos/npms-io/npms-cli/pulls/comments/78458197","id":78458197,"diff_hunk":"@@ -40,7 +31,11 @@ exports.handler = (argv) => {\n };\n \n function getService(argv, res) {\n-    if (argv.npms) { return `https://npms.io/search?term=${argv.package}`; }\n-    if (argv.npm) { return res.body.collected.metadata.links.npm; }\n-    return res.body.collected.metadata.links.repository || res.body.collected.metadata.links.npm;\n+    const links = res.body.collected.metadata.links;\n+\n+    if (argv.link) {\n+        if (argv.link === 'npms') { return `https://npms.io/search?term=${argv.package}`; }\n+        if (argv.link === 'npm') { return links.npm; }\n+    }\n+    return links.repository || links.npm || links.homepage;","path":"cmd/open.js","position":34,"original_position":46,"commit_id":"3875c0a03be371c7c13020e0183dab2cc02e917c","original_commit_id":"3875c0a03be371c7c13020e0183dab2cc02e917c","user":{"login":"satazor","id":1017236,"avatar_url":"https://avatars.githubusercontent.com/u/1017236?v=3","gravatar_id":"","url":"https://api.github.com/users/satazor","html_url":"https://github.com/satazor","followers_url":"https://api.github.com/users/satazor/followers","following_url":"https://api.github.com/users/satazor/following{/other_user}","gists_url":"https://api.github.com/users/satazor/gists{/gist_id}","starred_url":"https://api.github.com/users/satazor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satazor/subscriptions","organizations_url":"https://api.github.com/users/satazor/orgs","repos_url":"https://api.github.com/users/satazor/repos","events_url":"https://api.github.com/users/satazor/events{/privacy}","received_events_url":"https://api.github.com/users/satazor/received_events","type":"User","site_admin":false},"body":"`|| links.homepage` is unnecessary since `links.npm` always exists","created_at":"2016-09-12T21:27:09Z","updated_at":"2016-09-12T21:27:09Z","html_url":"https://github.com/npms-io/npms-cli/pull/17#discussion_r78458197","pull_request_url":"https://api.github.com/repos/npms-io/npms-cli/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/comments/78458197"},"html":{"href":"https://github.com/npms-io/npms-cli/pull/17#discussion_r78458197"},"pull_request":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/npms-io/npms-cli/pulls/17","id":84768870,"html_url":"https://github.com/npms-io/npms-cli/pull/17","diff_url":"https://github.com/npms-io/npms-cli/pull/17.diff","patch_url":"https://github.com/npms-io/npms-cli/pull/17.patch","issue_url":"https://api.github.com/repos/npms-io/npms-cli/issues/17","number":17,"state":"open","locked":false,"title":"010 add --npms --npm --github to open action","user":{"login":"mikeerickson","id":183153,"avatar_url":"https://avatars.githubusercontent.com/u/183153?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeerickson","html_url":"https://github.com/mikeerickson","followers_url":"https://api.github.com/users/mikeerickson/followers","following_url":"https://api.github.com/users/mikeerickson/following{/other_user}","gists_url":"https://api.github.com/users/mikeerickson/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeerickson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeerickson/subscriptions","organizations_url":"https://api.github.com/users/mikeerickson/orgs","repos_url":"https://api.github.com/users/mikeerickson/repos","events_url":"https://api.github.com/users/mikeerickson/events{/privacy}","received_events_url":"https://api.github.com/users/mikeerickson/received_events","type":"User","site_admin":false},"body":"- added `open --npms` option to open archive in `npms.io` service\r\n- added `open --npm` option to open archive in `npmjs.org` service\r\n- added `open --github` alias option to work same as open command (open in `github.com` service)\r\n- added appropriate tests\r\n- fixed `npm run test-travis` script to store coverage report in `test/coverage` (it was creating `coverage` in package directory)\r\n\r\nNOTE: All tests were executed repeated 100 times to assure no leaks, etc.\r\n\r\nISSUE: I did find that if I added `describe.only` to `open.spec.js` to test in isolation, it produced errors.  I can look at  this further if you all deem this an issue.","created_at":"2016-09-10T21:49:01Z","updated_at":"2016-09-12T21:27:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/npms-io/npms-cli/pulls/17/commits","review_comments_url":"https://api.github.com/repos/npms-io/npms-cli/pulls/17/comments","review_comment_url":"https://api.github.com/repos/npms-io/npms-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npms-io/npms-cli/issues/17/comments","statuses_url":"https://api.github.com/repos/npms-io/npms-cli/statuses/3875c0a03be371c7c13020e0183dab2cc02e917c","head":{"label":"mikeerickson:010-open-in-alternate-services","ref":"010-open-in-alternate-services","sha":"3875c0a03be371c7c13020e0183dab2cc02e917c","user":{"login":"mikeerickson","id":183153,"avatar_url":"https://avatars.githubusercontent.com/u/183153?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeerickson","html_url":"https://github.com/mikeerickson","followers_url":"https://api.github.com/users/mikeerickson/followers","following_url":"https://api.github.com/users/mikeerickson/following{/other_user}","gists_url":"https://api.github.com/users/mikeerickson/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeerickson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeerickson/subscriptions","organizations_url":"https://api.github.com/users/mikeerickson/orgs","repos_url":"https://api.github.com/users/mikeerickson/repos","events_url":"https://api.github.com/users/mikeerickson/events{/privacy}","received_events_url":"https://api.github.com/users/mikeerickson/received_events","type":"User","site_admin":false},"repo":{"id":67893032,"name":"npms-cli","full_name":"mikeerickson/npms-cli","owner":{"login":"mikeerickson","id":183153,"avatar_url":"https://avatars.githubusercontent.com/u/183153?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeerickson","html_url":"https://github.com/mikeerickson","followers_url":"https://api.github.com/users/mikeerickson/followers","following_url":"https://api.github.com/users/mikeerickson/following{/other_user}","gists_url":"https://api.github.com/users/mikeerickson/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeerickson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeerickson/subscriptions","organizations_url":"https://api.github.com/users/mikeerickson/orgs","repos_url":"https://api.github.com/users/mikeerickson/repos","events_url":"https://api.github.com/users/mikeerickson/events{/privacy}","received_events_url":"https://api.github.com/users/mikeerickson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikeerickson/npms-cli","description":"The CLI search utility for npms","fork":true,"url":"https://api.github.com/repos/mikeerickson/npms-cli","forks_url":"https://api.github.com/repos/mikeerickson/npms-cli/forks","keys_url":"https://api.github.com/repos/mikeerickson/npms-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikeerickson/npms-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikeerickson/npms-cli/teams","hooks_url":"https://api.github.com/repos/mikeerickson/npms-cli/hooks","issue_events_url":"https://api.github.com/repos/mikeerickson/npms-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mikeerickson/npms-cli/events","assignees_url":"https://api.github.com/repos/mikeerickson/npms-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mikeerickson/npms-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mikeerickson/npms-cli/tags","blobs_url":"https://api.github.com/repos/mikeerickson/npms-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikeerickson/npms-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikeerickson/npms-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikeerickson/npms-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikeerickson/npms-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mikeerickson/npms-cli/languages","stargazers_url":"https://api.github.com/repos/mikeerickson/npms-cli/stargazers","contributors_url":"https://api.github.com/repos/mikeerickson/npms-cli/contributors","subscribers_url":"https://api.github.com/repos/mikeerickson/npms-cli/subscribers","subscription_url":"https://api.github.com/repos/mikeerickson/npms-cli/subscription","commits_url":"https://api.github.com/repos/mikeerickson/npms-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikeerickson/npms-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikeerickson/npms-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikeerickson/npms-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikeerickson/npms-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mikeerickson/npms-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikeerickson/npms-cli/merges","archive_url":"https://api.github.com/repos/mikeerickson/npms-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikeerickson/npms-cli/downloads","issues_url":"https://api.github.com/repos/mikeerickson/npms-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mikeerickson/npms-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mikeerickson/npms-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mikeerickson/npms-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikeerickson/npms-cli/labels{/name}","releases_url":"https://api.github.com/repos/mikeerickson/npms-cli/releases{/id}","deployments_url":"https://api.github.com/repos/mikeerickson/npms-cli/deployments","created_at":"2016-09-10T20:31:47Z","updated_at":"2016-09-10T20:31:48Z","pushed_at":"2016-09-12T19:08:23Z","git_url":"git://github.com/mikeerickson/npms-cli.git","ssh_url":"git@github.com:mikeerickson/npms-cli.git","clone_url":"https://github.com/mikeerickson/npms-cli.git","svn_url":"https://github.com/mikeerickson/npms-cli","homepage":"","size":59,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"npms-io:master","ref":"master","sha":"f1b0f5fbfd5612a3787283c82000e2bef47de5a0","user":{"login":"npms-io","id":17166357,"avatar_url":"https://avatars.githubusercontent.com/u/17166357?v=3","gravatar_id":"","url":"https://api.github.com/users/npms-io","html_url":"https://github.com/npms-io","followers_url":"https://api.github.com/users/npms-io/followers","following_url":"https://api.github.com/users/npms-io/following{/other_user}","gists_url":"https://api.github.com/users/npms-io/gists{/gist_id}","starred_url":"https://api.github.com/users/npms-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npms-io/subscriptions","organizations_url":"https://api.github.com/users/npms-io/orgs","repos_url":"https://api.github.com/users/npms-io/repos","events_url":"https://api.github.com/users/npms-io/events{/privacy}","received_events_url":"https://api.github.com/users/npms-io/received_events","type":"Organization","site_admin":false},"repo":{"id":51465937,"name":"npms-cli","full_name":"npms-io/npms-cli","owner":{"login":"npms-io","id":17166357,"avatar_url":"https://avatars.githubusercontent.com/u/17166357?v=3","gravatar_id":"","url":"https://api.github.com/users/npms-io","html_url":"https://github.com/npms-io","followers_url":"https://api.github.com/users/npms-io/followers","following_url":"https://api.github.com/users/npms-io/following{/other_user}","gists_url":"https://api.github.com/users/npms-io/gists{/gist_id}","starred_url":"https://api.github.com/users/npms-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npms-io/subscriptions","organizations_url":"https://api.github.com/users/npms-io/orgs","repos_url":"https://api.github.com/users/npms-io/repos","events_url":"https://api.github.com/users/npms-io/events{/privacy}","received_events_url":"https://api.github.com/users/npms-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npms-io/npms-cli","description":"The CLI search utility for npms","fork":false,"url":"https://api.github.com/repos/npms-io/npms-cli","forks_url":"https://api.github.com/repos/npms-io/npms-cli/forks","keys_url":"https://api.github.com/repos/npms-io/npms-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npms-io/npms-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npms-io/npms-cli/teams","hooks_url":"https://api.github.com/repos/npms-io/npms-cli/hooks","issue_events_url":"https://api.github.com/repos/npms-io/npms-cli/issues/events{/number}","events_url":"https://api.github.com/repos/npms-io/npms-cli/events","assignees_url":"https://api.github.com/repos/npms-io/npms-cli/assignees{/user}","branches_url":"https://api.github.com/repos/npms-io/npms-cli/branches{/branch}","tags_url":"https://api.github.com/repos/npms-io/npms-cli/tags","blobs_url":"https://api.github.com/repos/npms-io/npms-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npms-io/npms-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npms-io/npms-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/npms-io/npms-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npms-io/npms-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/npms-io/npms-cli/languages","stargazers_url":"https://api.github.com/repos/npms-io/npms-cli/stargazers","contributors_url":"https://api.github.com/repos/npms-io/npms-cli/contributors","subscribers_url":"https://api.github.com/repos/npms-io/npms-cli/subscribers","subscription_url":"https://api.github.com/repos/npms-io/npms-cli/subscription","commits_url":"https://api.github.com/repos/npms-io/npms-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/npms-io/npms-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/npms-io/npms-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/npms-io/npms-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/npms-io/npms-cli/contents/{+path}","compare_url":"https://api.github.com/repos/npms-io/npms-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npms-io/npms-cli/merges","archive_url":"https://api.github.com/repos/npms-io/npms-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npms-io/npms-cli/downloads","issues_url":"https://api.github.com/repos/npms-io/npms-cli/issues{/number}","pulls_url":"https://api.github.com/repos/npms-io/npms-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/npms-io/npms-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/npms-io/npms-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npms-io/npms-cli/labels{/name}","releases_url":"https://api.github.com/repos/npms-io/npms-cli/releases{/id}","deployments_url":"https://api.github.com/repos/npms-io/npms-cli/deployments","created_at":"2016-02-10T19:26:24Z","updated_at":"2016-09-09T23:16:22Z","pushed_at":"2016-09-12T19:08:23Z","git_url":"git://github.com/npms-io/npms-cli.git","ssh_url":"git@github.com:npms-io/npms-cli.git","clone_url":"https://github.com/npms-io/npms-cli.git","svn_url":"https://github.com/npms-io/npms-cli","homepage":"","size":76,"stargazers_count":149,"watchers_count":149,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":3,"forks":8,"open_issues":3,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/17"},"html":{"href":"https://github.com/npms-io/npms-cli/pull/17"},"issue":{"href":"https://api.github.com/repos/npms-io/npms-cli/issues/17"},"comments":{"href":"https://api.github.com/repos/npms-io/npms-cli/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npms-io/npms-cli/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/npms-io/npms-cli/statuses/3875c0a03be371c7c13020e0183dab2cc02e917c"}}}}
{"actor":{"display_login":"satazor"}}