{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10815","labels_url":"https://api.github.com/repos/npm/npm/issues/10815/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10815/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10815/events","html_url":"https://github.com/npm/npm/issues/10815","id":122182120,"number":10815,"title":"Value of $npm_package_repository_url in a script different from value in package.json","user":{"login":"ELLIOTTCABLE","id":200,"avatar_url":"https://avatars.githubusercontent.com/u/200?v=3","gravatar_id":"","url":"https://api.github.com/users/ELLIOTTCABLE","html_url":"https://github.com/ELLIOTTCABLE","followers_url":"https://api.github.com/users/ELLIOTTCABLE/followers","following_url":"https://api.github.com/users/ELLIOTTCABLE/following{/other_user}","gists_url":"https://api.github.com/users/ELLIOTTCABLE/gists{/gist_id}","starred_url":"https://api.github.com/users/ELLIOTTCABLE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ELLIOTTCABLE/subscriptions","organizations_url":"https://api.github.com/users/ELLIOTTCABLE/orgs","repos_url":"https://api.github.com/users/ELLIOTTCABLE/repos","events_url":"https://api.github.com/users/ELLIOTTCABLE/events{/privacy}","received_events_url":"https://api.github.com/users/ELLIOTTCABLE/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/package-json","name":"package-json","color":"e1e121"},{"url":"https://api.github.com/repos/npm/npm/labels/support","name":"support","color":"FF91AF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-15T02:59:29Z","updated_at":"2015-12-16T22:02:05Z","closed_at":null,"body":"With this line in the `package.json`,\r\n\r\n    \"repository\" : {\"type\" : \"git\", \"url\" : \"https://github.com/Blah/Widget.git\"}\r\n\r\n`npm run-script` provides the following value as `\"$npm_package_repository_url\"`:\r\n\r\n    git+https://github.com/Blah/Widget.git\r\n\r\nThis fails with commands like `git clone ${npm_package_repository_url }` and similar. As far as I can tell, this is the only property which comes out *differently* in a env-var than it's encoded in the `package.json`; I can't tell if this is intended, but undocumented, functionality; or a strange bug. (What even *is* that syntax?)"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/165266391","html_url":"https://github.com/npm/npm/issues/10815#issuecomment-165266391","issue_url":"https://api.github.com/repos/npm/npm/issues/10815","id":165266391,"user":{"login":"ELLIOTTCABLE","id":200,"avatar_url":"https://avatars.githubusercontent.com/u/200?v=3","gravatar_id":"","url":"https://api.github.com/users/ELLIOTTCABLE","html_url":"https://github.com/ELLIOTTCABLE","followers_url":"https://api.github.com/users/ELLIOTTCABLE/followers","following_url":"https://api.github.com/users/ELLIOTTCABLE/following{/other_user}","gists_url":"https://api.github.com/users/ELLIOTTCABLE/gists{/gist_id}","starred_url":"https://api.github.com/users/ELLIOTTCABLE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ELLIOTTCABLE/subscriptions","organizations_url":"https://api.github.com/users/ELLIOTTCABLE/orgs","repos_url":"https://api.github.com/users/ELLIOTTCABLE/repos","events_url":"https://api.github.com/users/ELLIOTTCABLE/events{/privacy}","received_events_url":"https://api.github.com/users/ELLIOTTCABLE/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T22:02:05Z","updated_at":"2015-12-16T22:02:05Z","body":"I mean, of what use is *npm*'s internal format? I understand how ‘npm exposes whatever's set internally’ is *simple* to understand, but … I'm kind of surprised that we're not on the same page that that behaviour isn't *useful* or *desirable* to people outside of npm?\r\n\r\nLike, unless I'm not understanding some use-case that the envvars are exposed for, they're for scripts to operate based on, right? But a value exposed in some internal format is … not useful to operate on. (Even if I know, and can fix, that value myself.)\r\n\r\nFor instance, this is what I'm resorting to at the moment to get the same data:\r\n\r\n    repository_url=\"$(node -pe \"require('./package').repository.url\")\"\r\n\r\nNow, this obviously isn't, like, super-important to me or anything. There *are* a dozen easy ways around it. I'm just pointing out that I think exposing internal configuration data is less-useful to a large array of scripting purposes, than exposing the actual data in the `package.json`? (I *can* list use-cases for scripts using the data in `package.json`, if you'd like, but I feel like you can imagine)"}}