News for hackers. Stuff that matters.
Re:Huge no. of files for Angular 2 by Touche on Tuesday August 02, 2016 @07:47AM (#12209196)
It's actually not possible due to the way Node looks up dependencies. You could have a situation like:

  node_modules/
    a/
      node_modules/
        c/ (1.0.0)
    b/
      node_modules/
        c/ (1.0.0)
    c/ (2.0.0)
Both a and b depend on c version 1.0.0, but since there's a version 2.0.0 in the root node_modules folder c can't be placed there, and has to be duplicated in a and b's own node_modules folder, otherwise Node couldn't find it for each of them.
Re:Huge no. of files for Angular 2 by ksherlock on Tuesday August 02, 2016 @08:47AM (#12209513)
It's entirely possible with symbolic links. https://github.com/rstacruz/pnpm
Re:Huge no. of files for Angular 2 by rplnt on Tuesday August 02, 2016 @07:51AM (#12209216)
You could use links, version in names, ... You'd just have problem to take out one submodule I guess, but I doubt that's a use case anywhere.
Re:Huge no. of files for Angular 2 by RossM on Tuesday August 02, 2016 @09:41AM (#12209837)
I've built a fairly hacky solution to this before (for a different package manager) - it can be pretty simple:

    node_modules/
        versions/
            [email protected]
                node_modules/
                    c -> ../../[email protected]
            [email protected]
                node_modules/
                    c -> ../../[email protected]
            [email protected]/
            [email protected]/
        a -> versions/[email protected]
        b -> versions/[email protected]
        c -> versions/[email protected]
Re:Huge no. of files for Angular 2 by Touche on Tuesday August 02, 2016 @10:21AM (#12210111)
Some other people have linked to npm alternatives ied and pnpm which do essentially this.