{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/1278","labels_url":"https://api.github.com/repos/iojs/io.js/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/1278/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/1278/events","html_url":"https://github.com/iojs/io.js/issues/1278","id":64618842,"number":1278,"title":"Compressed packages","user":{"login":"piranna","id":532414,"avatar_url":"https://avatars.githubusercontent.com/u/532414?v=3","gravatar_id":"","url":"https://api.github.com/users/piranna","html_url":"https://github.com/piranna","followers_url":"https://api.github.com/users/piranna/followers","following_url":"https://api.github.com/users/piranna/following{/other_user}","gists_url":"https://api.github.com/users/piranna/gists{/gist_id}","starred_url":"https://api.github.com/users/piranna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piranna/subscriptions","organizations_url":"https://api.github.com/users/piranna/orgs","repos_url":"https://api.github.com/users/piranna/repos","events_url":"https://api.github.com/users/piranna/events{/privacy}","received_events_url":"https://api.github.com/users/piranna/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/io.js/labels/module","name":"module","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-26T19:55:14Z","updated_at":"2015-03-27T08:47:09Z","closed_at":null,"body":"(Originally posted at [Node.js](https://github.com/joyent/node/issues/14169))\r\n\r\nAllow to require() compressed packages as dependencies inside ǹode_modules folder, the same way Python does. The idea is to use less disk space and make transfer of projects faster, since it will only move one file instead of a set of them. Also it would allow to checksum them, obviously in this case the comprossed package would not have inside its dependencies except if sringwash or bundleDependencies are being used, but the Node.js packages resolution algorythm (search for a node_modules in the current folder and all its parents until /) would be capable to solve this.\r\n\r\nTo do so, the only change would be that when a compressed (.zip?) file is found inside the node_modules folder, expand it dynamically and process the package.json file the same way it would do with folders."},"comment":{"url":"https://api.github.com/repos/iojs/io.js/issues/comments/86870585","html_url":"https://github.com/iojs/io.js/issues/1278#issuecomment-86870585","issue_url":"https://api.github.com/repos/iojs/io.js/issues/1278","id":86870585,"user":{"login":"llafuente","id":752124,"avatar_url":"https://avatars.githubusercontent.com/u/752124?v=3","gravatar_id":"","url":"https://api.github.com/users/llafuente","html_url":"https://github.com/llafuente","followers_url":"https://api.github.com/users/llafuente/followers","following_url":"https://api.github.com/users/llafuente/following{/other_user}","gists_url":"https://api.github.com/users/llafuente/gists{/gist_id}","starred_url":"https://api.github.com/users/llafuente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llafuente/subscriptions","organizations_url":"https://api.github.com/users/llafuente/orgs","repos_url":"https://api.github.com/users/llafuente/repos","events_url":"https://api.github.com/users/llafuente/events{/privacy}","received_events_url":"https://api.github.com/users/llafuente/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T08:47:09Z","updated_at":"2015-03-27T08:47:09Z","body":"How about new ways to do things...\r\n\r\n```js\r\nrequire(\"xxx\")\r\n```\r\n\r\n* current logic\r\n* if everything fails -> read node_modules.zip (That must be UNIQUE)\r\n\r\nThat leads to the following problems (exposed above)\r\n* filesystem staff (fs operations, spawn)\r\n\r\n  use a new protocol, by default we should be using file://, how about node:// to search in the archive\r\n\r\n  Usage example:\r\n  ```js\r\nvar i_need_my_data = fs.readFileSync(\"node:///my-module/data/data.csv\");\r\n  ```\r\n\r\n* __dinarme\r\n\r\n  can be \"node:///my-module\"\r\n\r\n* build-steps (gyp)\r\n\r\n  I don't know exactly how to make executable work module files (node:// won't work at OS level).\r\n  So extract everything.\r\n  But this is part of `npm install` so maybe we can install eveything normally and after postinstall eveything compress just in the end.\r\n\r\n\r\nIn the end we need to keep legacy code working, so I would add something to `package.json`, something like `\"compess\" : true` (false by default)\r\nThis way the developer will take care of the necessary steps needed to adapt the module.\r\n\r\nHope \"node://\" idea solve many problems."}}