--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/53851C5A.30101%40fecrd.cujae.edu.cu.
For more options, visit https://groups.google.com/d/optout.
There is something similar to what you want to do, and it is the dedupe command of npm (npm help dedupe). Completely flattening the node_modules folder could not be possible, because there could be transitive dependencies on the same module with different versions - which version to use in this case?. Anyway, dedupe is a best effort to optimize the dependencies of your project.
On 28/05/14 10:23, Aria Stewart wrote:
No. But npm dedup might get you close. It's only theoretically possible if your dependencies are transitively compatible -- which is not something many people put effort into, since it's not required except to move dependencies to the root. What are you actually trying to accomplish? Aria
Thanks for the answer.
I try `npm depupe`, but not very happy because the dependencies packages have different versions of common dependencies.
I ever wished a npm structure like this:
node_modules/
| package1/
| | version1/
| | version2/
| | ....
| | versionN
| package2/
| | version1/
| | version2/
| | ....
| | versionN
....
And maybe node resolve the path for `require` on starting the application reading de package.json.
Anybody else wished this?
Thanks.
50 Aniversario de la Cujae. Inaugurada por Fidel el 2 de diciembre de 1964 http://cujae.edu.cu
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/5386657B.3000903%40fecrd.cujae.edu.cu.
On Mon, Jun 2, 2014 at 10:48 AM, CoolAJ86 <cool...@gmail.com> wrote:
In my wildest dreams there is a universe in which a future version of npm versions packages in a global node_modules folder like this:
node_modules/thi...@1.6.7-rc1+aef123/package.json
But with the way many authors currently treat modules, there's still a problem there:
Many modules give you singletons by default and some have no way of creating instances, which means that the only true way to create an instance is to have a separate copy of the code.
This isn’t really npm’s call to make. The only way to make require("thingy") map to node_modules/thi...@1.6.7-rc1+aef123 would be to make fairly invasive changes to the Node module loader, which has to be one of the most most locked-down chunks of Node’s API. I definitely want to see npm dedupe work properly, but a flat module structure seems extremely unlikely in Node as long as it’s still called Node.
F
In my wildest dreams there is a universe in which a future version of npm versions packages in a global node_modules folder like this:
node_modules/thi...@1.6.7-rc1+aef123/package.json
But with the way many authors currently treat modules, there's still a problem there:
Many modules give you singletons by default and some have no way of creating instances, which means that the only true way to create an instance is to have a separate copy of the code.
Am Montag, 2. Juni 2014 19:48:51 UTC+2 schrieb CoolAJ86:In my wildest dreams there is a universe in which a future version of npm versions packages in a global node_modules folder like this:
this would be a nightmare
node_modules/thi...@1.6.7-rc1+aef123/package.json
But with the way many authors currently treat modules, there's still a problem there:
Many modules give you singletons by default and some have no way of creating instances, which means that the only true way to create an instance is to have a separate copy of the code.which is ok. many modules don't have state (logic should be singleton) or encapsulate resources which you would wan't to be present once only in your app anyway, like db connections. However, if there is a module, that shouldn't be a singleton, then open an issue and make a pr :)