{"versions":{"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":"anonymous","email":"thlorenz@gmx.de"},"dist":{"shasum":"06e44c223f5e4e94d78ef9db23a6515ce2f962a1","size":3673,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz","integrity":"sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ=="},"maintainers":[{"name":"anonymous","email":"thlorenz@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamic-dedupe-0.3.0.tgz_1509656529878_0.7220152113586664"},"directories":{},"publish_time":1509656529937,"_hasShrinkwrap":false,"_cnpm_publish_time":1509656529937,"_cnpmcore_publish_time":"2021-12-18T14:18:51.554Z","contributors":[]},"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"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.2.0","dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dynamic-dedupe/-/dynamic-dedupe-0.2.0.tgz","shasum":"50f7c28684831ecf1c170aab67a1d5311cdd76ce","size":3727,"noattachment":false,"integrity":"sha512-9X7t4pHNyrQmweKCpwUu+p1uJbr3v/hmoQvuGamHHknwnS3OCmkJJ3BngTSAWmC9DLYmdL1yyUBpI7eh26uMkw=="},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"anonymous","email":"thlorenz@gmx.de"},"maintainers":[{"name":"anonymous","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1377113941076,"_hasShrinkwrap":false,"_cnpm_publish_time":1377113941076,"_cnpmcore_publish_time":"2021-12-18T14:18:51.803Z","contributors":[]},"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"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.1.1","dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dynamic-dedupe/-/dynamic-dedupe-0.1.1.tgz","shasum":"17a6c760c42b7c9a8a0fa028134545ae1d12832f","size":3446,"noattachment":false,"integrity":"sha512-Dkx7uQXMmnLg8JaIq7W3qqJyLS1Mv1pv4GaGsL8i60SpRaBeFjqPNHHE5FNGTscuLRLm0I2PzBQJwqjFS1qdlA=="},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"anonymous","email":"thlorenz@gmx.de"},"maintainers":[{"name":"anonymous","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1377110348423,"_hasShrinkwrap":false,"_cnpm_publish_time":1377110348423,"_cnpmcore_publish_time":"2021-12-18T14:18:52.001Z","contributors":[]},"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"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/dynamic-dedupe/issues"},"_id":"dynamic-dedupe@0.1.0","dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dynamic-dedupe/-/dynamic-dedupe-0.1.0.tgz","shasum":"0a9a18cec4561efa59b370e6b6f6e2a972f35cbb","size":3105,"noattachment":false,"integrity":"sha512-U5ykG/z9CuNS05IiTH4tsnEF+hOyXmeXP5/xwlMrPVwA9AILwM4swcAfBP9JkY+T65xE4cDb473kfju2z4+dYA=="},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"anonymous","email":"thlorenz@gmx.de"},"maintainers":[{"name":"anonymous","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1377109263932,"_hasShrinkwrap":false,"_cnpm_publish_time":1377109263932,"_cnpmcore_publish_time":"2021-12-18T14:18:52.243Z","contributors":[]}},"dist-tags":{"latest":"0.3.0"},"name":"dynamic-dedupe","time":{"created":"2022-01-26T21:14:05.376Z","modified":"2023-07-31T11:54:35.428Z","0.3.0":"2017-11-02T21:02:09.937Z","0.2.0":"2013-08-21T19:39:01.076Z","0.1.1":"2013-08-21T18:39:08.423Z","0.1.0":"2013-08-21T18:21:03.932Z"},"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","users":{}}