{"action":"created","issue":{"url":"https://api.github.com/repos/badges/shields/issues/435","labels_url":"https://api.github.com/repos/badges/shields/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/badges/shields/issues/435/comments","events_url":"https://api.github.com/repos/badges/shields/issues/435/events","html_url":"https://github.com/badges/shields/pull/435","id":72235304,"number":435,"title":"Support npm scopes","user":{"login":"wilmoore","id":51953,"avatar_url":"https://avatars.githubusercontent.com/u/51953?v=3","gravatar_id":"","url":"https://api.github.com/users/wilmoore","html_url":"https://github.com/wilmoore","followers_url":"https://api.github.com/users/wilmoore/followers","following_url":"https://api.github.com/users/wilmoore/following{/other_user}","gists_url":"https://api.github.com/users/wilmoore/gists{/gist_id}","starred_url":"https://api.github.com/users/wilmoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilmoore/subscriptions","organizations_url":"https://api.github.com/users/wilmoore/orgs","repos_url":"https://api.github.com/users/wilmoore/repos","events_url":"https://api.github.com/users/wilmoore/events{/privacy}","received_events_url":"https://api.github.com/users/wilmoore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T18:02:36Z","updated_at":"2015-05-04T22:18:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/badges/shields/pulls/435","html_url":"https://github.com/badges/shields/pull/435","diff_url":"https://github.com/badges/shields/pull/435.diff","patch_url":"https://github.com/badges/shields/pull/435.patch"},"body":"As reported in #429, this PR allows support for npm scopes via encoding the package name. The issue is that scopes use a separator character which is the same as the URL path separator.\r\n\r\n## Without encoding (does not work)\r\n\r\n```shell\r\ncurl -i https://registry.npmjs.org/@wilmoore/accessor/latest\r\n```\r\n\r\n###### The headers indicate:\r\n\r\n```\r\nHTTP/1.1 401 Unauthorized\r\nnpm-notice: ERROR: you cannot fetch versions for scoped packages\r\n```\r\n\r\n## With encoding (works)\r\n\r\n```shell\r\ncurl -i https://registry.npmjs.org/%40wilmoore%2Faccessor/latest\r\n```\r\n\r\n###### The headers now indicate:\r\n\r\n```\r\nHTTP/1.1 200 OK\r\nContent-Type: application/json\r\n```\r\n\r\n###### The JSON result looks like:\r\n\r\n```json\r\n{\r\n  \"name\": \"@wilmoore/accessor\",\r\n  \"description\": \"Higher-Order getter/setter.\",\r\n  \"version\": \"0.2.0\",\r\n  \"author\": {\r\n    \"name\": \"Wil Moore III\",\r\n    \"email\": \"wil.moore@wilmoore.com\"\r\n  },\r\n  \"bugs\": {\r\n    \"url\": \"https://github.com/wilmoore/accessor.js/issues\"\r\n  },\r\n  \"dependencies\": {},\r\n  \"devDependencies\": {\r\n    \"istanbul\": \"^0.3.13\",\r\n    \"nodemon\": \"^1.3.7\",\r\n    \"standard\": \"^3.7.1\",\r\n    \"tap-spec\": \"^2.2.2\",\r\n    \"tape\": \"^4.0.0\",\r\n    \"tape-catch\": \"^1.0.4\"\r\n  },\r\n  \"homepage\": \"https://github.com/wilmoore/accessor.js\",\r\n  \"keywords\": [\r\n    \"Object.defineProperty\",\r\n    \"accessor\",\r\n    \"accessors\",\r\n    \"define\",\r\n    \"defineProperty\",\r\n    \"get\",\r\n    \"getter\",\r\n    \"higher-order\",\r\n    \"object\",\r\n    \"properties\",\r\n    \"property\",\r\n    \"set\",\r\n    \"setter\"\r\n  ],\r\n  \"license\": \"MIT\",\r\n  \"main\": \"index.js\",\r\n  \"private\": false,\r\n  \"repository\": {\r\n    \"type\": \"git\",\r\n    \"url\": \"git+https://github.com/wilmoore/accessor.js.git\"\r\n  },\r\n  \"scripts\": {\r\n    \"cover\": \"istanbul cover test.js\",\r\n    \"dev\": \"nodemon -x 'npm run test --silent' -e 'js json'\",\r\n    \"standard\": \"standard\",\r\n    \"test\": \"npm run standard --silent && node test.js | tap-spec\"\r\n  },\r\n  \"gitHead\": \"71e71d4c91fb69c304c53d9ebf2918e69242325a\",\r\n  \"_id\": \"@wilmoore/accessor@0.2.0\",\r\n  \"_shasum\": \"ff1f79d19048a419f72dfa557c4db3a8d211f901\",\r\n  \"_from\": \".\",\r\n  \"_npmVersion\": \"2.8.4\",\r\n  \"_nodeVersion\": \"0.12.0\",\r\n  \"_npmUser\": {\r\n    \"name\": \"wilmoore\",\r\n    \"email\": \"wil.moore@wilmoore.com\"\r\n  },\r\n  \"maintainers\": [\r\n    {\r\n      \"name\": \"wilmoore\",\r\n      \"email\": \"wil.moore@wilmoore.com\"\r\n    }\r\n  ],\r\n  \"dist\": {\r\n    \"shasum\": \"ff1f79d19048a419f72dfa557c4db3a8d211f901\",\r\n    \"tarball\": \"http://registry.npmjs.org/@wilmoore/accessor/-/accessor-0.2.0.tgz\"\r\n  },\r\n  \"directories\": {}\r\n}\r\n```\r\n\r\nThere is one caveat. The downloads tracking API for scoped packages is closed off. This is easy to spot by simply looking at any npm package page for a scoped package (no downloads are show).\r\n\r\n- https://www.npmjs.com/package/@wilmoore/accessor\r\n- https://www.npmjs.com/package/@yummies/inherit-loader\r\n\r\nThis is a known issue as noted at https://github.com/npm/download-counts/issues/23. For now, this resolves the license and version links as depicted below:\r\n\r\n## version image\r\n\r\n![](https://cloudup.com/c9ZuUbrtuLt+)\r\n\r\n## license image\r\n\r\n![](https://cloudup.com/c5aL1s4y9vs+)\r\n\r\n## downloads images (no data seems to be captured)\r\n\r\n![](https://cloudup.com/c-Wavp_w4dB+)\r\n"},"comment":{"url":"https://api.github.com/repos/badges/shields/issues/comments/98866908","html_url":"https://github.com/badges/shields/pull/435#issuecomment-98866908","issue_url":"https://api.github.com/repos/badges/shields/issues/435","id":98866908,"user":{"login":"kgryte","id":2643044,"avatar_url":"https://avatars.githubusercontent.com/u/2643044?v=3","gravatar_id":"","url":"https://api.github.com/users/kgryte","html_url":"https://github.com/kgryte","followers_url":"https://api.github.com/users/kgryte/followers","following_url":"https://api.github.com/users/kgryte/following{/other_user}","gists_url":"https://api.github.com/users/kgryte/gists{/gist_id}","starred_url":"https://api.github.com/users/kgryte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgryte/subscriptions","organizations_url":"https://api.github.com/users/kgryte/orgs","repos_url":"https://api.github.com/users/kgryte/repos","events_url":"https://api.github.com/users/kgryte/events{/privacy}","received_events_url":"https://api.github.com/users/kgryte/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T22:18:23Z","updated_at":"2015-05-04T22:18:23Z","body":"+1."}}