{"_id":"dynamic-dedupe","_rev":"14-ce7decdfb5e19287b689d7ed8f9a4722","name":"dynamic-dedupe","description":"Dedupes node modules as they are being required  which works even when dependencies are linked via ln -s or npm link.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"dynamic-dedupe","version":"0.1.0","description":"Dedupes node modules on the fly which works even when dependencies are linked via ln -s or npm link.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi"},"repository":{"type":"git","url":"git://github.com/thlorenz/dynamic-dedupe.git"},"homepage":"https://github.com/thlorenz/dynamic-dedupe","dependencies":{"xtend":"~2.0.6"},"devDependencies":{"nave":"~0.4.3","tap":"~0.4.3"},"keywords":[],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/dynamic-dedupe/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.1.0","dist":{"shasum":"0a9a18cec4561efa59b370e6b6f6e2a972f35cbb","tarball":"https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.1.0.tgz","integrity":"sha512-U5ykG/z9CuNS05IiTH4tsnEF+hOyXmeXP5/xwlMrPVwA9AILwM4swcAfBP9JkY+T65xE4cDb473kfju2z4+dYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ4gUZRMVlTzfBDpgIqF7JOAV1GR0fs+NodtgvzIdSKgIhAMMRbyEJRJii1pWiLjsxJoVCDo5PlSFvetAxJeoiwOyQ"}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.1.1":{"name":"dynamic-dedupe","version":"0.1.1","description":"Dedupes node modules as they are being required  which works even when dependencies are linked via ln -s or npm link.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi"},"repository":{"type":"git","url":"git://github.com/thlorenz/dynamic-dedupe.git"},"homepage":"https://github.com/thlorenz/dynamic-dedupe","dependencies":{"xtend":"~2.0.6"},"devDependencies":{"nave":"~0.4.3","tap":"~0.4.3"},"keywords":["dedupe","npm","require","extension","link"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/dynamic-dedupe/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.1.1","dist":{"shasum":"17a6c760c42b7c9a8a0fa028134545ae1d12832f","tarball":"https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.1.1.tgz","integrity":"sha512-Dkx7uQXMmnLg8JaIq7W3qqJyLS1Mv1pv4GaGsL8i60SpRaBeFjqPNHHE5FNGTscuLRLm0I2PzBQJwqjFS1qdlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzsxpjJD9mTCeKGAGm5e6VqLXslJYHswgDxIbKk9yWvAiEA4wLYM0HrP8q2Re3oD7DH8N81W/gtSFSXexSGNHenxSU="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.2.0":{"name":"dynamic-dedupe","version":"0.2.0","description":"Dedupes node modules as they are being required  which works even when dependencies are linked via ln -s or npm link.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi"},"repository":{"type":"git","url":"git://github.com/thlorenz/dynamic-dedupe.git"},"homepage":"https://github.com/thlorenz/dynamic-dedupe","dependencies":{"xtend":"~2.0.6"},"devDependencies":{"nave":"~0.4.3","tap":"~0.4.3"},"keywords":["dedupe","npm","require","extension","link"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/dynamic-dedupe/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.2.0","dist":{"shasum":"50f7c28684831ecf1c170aab67a1d5311cdd76ce","tarball":"https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.2.0.tgz","integrity":"sha512-9X7t4pHNyrQmweKCpwUu+p1uJbr3v/hmoQvuGamHHknwnS3OCmkJJ3BngTSAWmC9DLYmdL1yyUBpI7eh26uMkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9PGmgYOHerv+RRl1DEmr3Zit0JBTMfeYHHK6JSopinQIhANhB/vZLqDRYcEcW7rL5ECoXjnF0ZZ7OmZlEOatKvy6O"}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.3.0":{"name":"dynamic-dedupe","version":"0.3.0","description":"Dedupes node modules as they are being required  which works even when dependencies are linked via ln -s or npm link.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi"},"repository":{"type":"git","url":"git://github.com/thlorenz/dynamic-dedupe.git"},"homepage":"https://github.com/thlorenz/dynamic-dedupe","dependencies":{"xtend":"^4.0.0"},"devDependencies":{"nave":"~0.4.3","tap":"~0.4.3"},"keywords":["dedupe","npm","require","extension","link"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/dynamic-dedupe/blob/master/LICENSE"},"engine":{"node":">=0.6"},"gitHead":"d9d4b196c46ea3e5ac3d16ed08ca407eea603841","bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.3.0","_shasum":"06e44c223f5e4e94d78ef9db23a6515ce2f962a1","_from":".","_npmVersion":"2.15.12","_nodeVersion":"8.8.1","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"dist":{"shasum":"06e44c223f5e4e94d78ef9db23a6515ce2f962a1","tarball":"https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz","integrity":"sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5S5nG6qBmvZeO7KjLZLZafihUvmpvGIJ321jKASh2ZQIhANb+ojLnhhZoC9Fw5vwrkjgh6T3a8gbOwRc/fhpvb+nG"}]},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamic-dedupe-0.3.0.tgz_1509656529878_0.7220152113586664"}}},"readme":"# dynamic-dedupe\n\nDedupes node modules as they are being required  which works even when dependencies are linked via ln -s or npm link.\n\n### Not deduped \n\nLoads `foo.js` module only twice.\n\n```js\nvar foo1 = require('./pack1/common/dep-uno/foo');\nvar foo2 = require('./pack2/common/dep-uno/foo');\n\nconsole.log(foo1.foo);\nconsole.log(foo2.foo);\n\nconsole.log(foo1 === foo2);\n\n// =>\n// loading foo from /Users/thlorenz/dev/projects/dynamic-dedupe/example/pack1/common/dep-uno\n// loading foo from /Users/thlorenz/dev/projects/dynamic-dedupe/example/pack2/common/dep-uno\n// foobiloo\n// foobiloo\n// false\n```\n\n### Deduped\n\nLoads `foo.js` module only once.\n\n```js\nvar dedupe = require('../');\ndedupe.activate();\n\nvar foo1 = require('./pack1/dep-uno/foo');\nvar foo2 = require('./pack2/dep-uno/foo');\n\nconsole.log(foo1.foo);\nconsole.log(foo2.foo);\n\nconsole.log(foo1 === foo2);\n\n// =>\n// loading foo from /Users/thlorenz/dev/projects/dynamic-dedupe/example/pack1/common/dep-uno\n// foobiloo\n// foobiloo\n// true\n```\n\nHere instead of loading `pack2/dep-uno/foo1.js` we will get a reference to the exports of `pack1/dep-uno/foo`.js`\nreturned.\n\n\n## Why?\n\nIn some cases an app may be split into multiple parts that need to get the same instance of a common dependency (i.e.\nHandlebars). This will work once you run `npm dedupe` from the main package. However once you try linking to a\ndependency via `npm link` or just `ln -s` it breaks.\n\nThis is where dynamic-dedupe comes in since it dedupes your modules as they are being required. Just **make sure that\nyou are using the exact same version** of the packages whose modules you dedupe in order for this to work reliably.\n\n## Installation\n\n    npm install dynamic-dedupe\n\n## API\n\n###*dedupe.activate([ext, subdirs])*\n\n```\n/**\n * Activates deduping for files with the given extension.\n * \n * @name activate\n * @function\n * @param ext {String} (optional) extension for which to activate deduping (default: '.js')\n * @param subdirs {Number} (optional) how many subdirs right above the module\n *    have to be the same in order for it to be considered identical  (default: 2)\n *\n *  Example: sudirs: 2 -- x/foo/bar/main.js === y/foo/bar/main.js\n *                        x/boo/bar/main.js !== y/foo/bar/main.js\n */\n```\n\n###*dedupe.deactivate([ext])*\n\n```\n/**\n * Deactivates deduping files with the given extension.\n * \n * @name deactivate\n * @function\n * @param ext {String} (optional) extension for which to activate deduping (default: '.js')\n */\n```\n\n###*dedupe.reset()*\n\n```\n/**\n * Clears the registry that contains previously loaded modules.\n * \n * @name reset\n * @function\n */\n```\n\n## License\n\nMIT\n","maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2022-06-16T02:33:04.776Z","created":"2013-08-21T18:21:03.034Z","0.1.0":"2013-08-21T18:21:03.932Z","0.1.1":"2013-08-21T18:39:08.423Z","0.2.0":"2013-08-21T19:39:01.076Z","0.3.0":"2017-11-02T21:02:09.937Z"},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"repository":{"type":"git","url":"git://github.com/thlorenz/dynamic-dedupe.git"},"users":{"majj":true,"wenbing":true},"homepage":"https://github.com/thlorenz/dynamic-dedupe","keywords":["dedupe","npm","require","extension","link"],"bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"license":{"type":"MIT","url":"https://github.com/thlorenz/dynamic-dedupe/blob/master/LICENSE"},"readmeFilename":"README.md"}