{"action":"closed","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10558","labels_url":"https://api.github.com/repos/npm/npm/issues/10558/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10558/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10558/events","html_url":"https://github.com/npm/npm/issues/10558","id":118973985,"number":10558,"title":"Dedupe bundled node_modules?","user":{"login":"ChALkeR","id":291301,"avatar_url":"https://avatars.githubusercontent.com/u/291301?v=3","gravatar_id":"","url":"https://api.github.com/users/ChALkeR","html_url":"https://github.com/ChALkeR","followers_url":"https://api.github.com/users/ChALkeR/followers","following_url":"https://api.github.com/users/ChALkeR/following{/other_user}","gists_url":"https://api.github.com/users/ChALkeR/gists{/gist_id}","starred_url":"https://api.github.com/users/ChALkeR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChALkeR/subscriptions","organizations_url":"https://api.github.com/users/ChALkeR/orgs","repos_url":"https://api.github.com/users/ChALkeR/repos","events_url":"https://api.github.com/users/ChALkeR/events{/privacy}","received_events_url":"https://api.github.com/users/ChALkeR/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/feature-request","name":"feature-request","color":"ACE1AF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T05:22:06Z","updated_at":"2015-12-04T23:30:49Z","closed_at":"2015-12-04T23:30:49Z","body":"Previous issue: #8416\r\nThe version that I am looking at is 3.5.1.\r\n\r\n--\r\nThere are 3 copies of `are-we-there-yet`, and all of those have the same version:\r\n```\r\n./node_modules/npmlog/node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\",\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\",\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\",\r\n```\r\nThe first and the last ones are identical, the second one differs from them in versions of `readable-stream → core-util-is` (1.0.1 and 1.0.2) and the order of the lines in two other package.json in deps (insignificant). I guess those three could be grouped, saving about 0.6 MiB (~3%).\r\n\r\n--\r\nAnother 3% is taken up by two extra `gauge` copies:\r\n```\r\n./node_modules/npmlog/node_modules/gauge/package.json:  \"version\": \"1.2.2\",\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json:  \"version\": \"1.2.2\",\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/package.json:  \"version\": \"1.2.2\",\r\n```\r\nAll those are completely identical.\r\n\r\n--\r\nSix identical copies of `string_decoder`:\r\n```\r\n./node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\",\r\n./node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\",\r\n./node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\"\r\n./node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\",\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\"\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/package.json:  \"version\": \"0.10.31\",\r\n```\r\n--\r\nThree identical copies of `util-deprecate`:\r\n```\r\n./node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json:  \"version\": \"1.0.2\",\r\n./node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json:  \"version\": \"1.0.2\",\r\n./node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json:  \"version\": \"1.0.2\",\r\n```\r\n--\r\nThree identical copies of `process-nextick-args`:\r\n```\r\n./node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json:  \"version\": \"1.0.3\",\r\n./node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json:  \"version\": \"1.0.3\",\r\n./node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json:  \"version\": \"1.0.3\",\r\n```\r\n--\r\nSix identical copies of `isarray`:\r\n```\r\n./node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\",\r\n./node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\",\r\n./node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\"\r\n./node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\",\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\"\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/package.json:  \"version\": \"0.0.1\",\r\n```\r\n--\r\nThree copies of `brace-expansion` (with the only actual difference being the version of `balanced-match` dep):\r\n```\r\n./node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json:  \"version\": \"1.1.1\",\r\n./node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json:  \"version\": \"1.1.1\",\r\n./node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json:  \"version\": \"1.1.1\"\r\n```\r\n--\r\nThere could be more. Also note that an `npm dedupe` run saves about 4.5%, but it doesn't dedupe everything mentioned above for some reason. After dedupe:\r\n```\r\n./node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\"\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\",\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/are-we-there-yet/package.json:  \"version\": \"1.0.4\",\r\n\r\n./node_modules/gauge/package.json:  \"version\": \"1.2.2\"\r\n./node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json:  \"version\": \"1.2.2\",\r\n./node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/package.json:  \"version\": \"1.2.2\",\r\n\r\n…\r\n```"}}