{"_id":"@custom-elements-manifest/find-dependencies","_rev":"9-c0a4d50ccc5e144a61a7066d9a1a49b4","name":"@custom-elements-manifest/find-dependencies","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.1","keywords":[],"author":{},"license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.1","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"dist":{"shasum":"a8d6009344db9dfc547ba2e75dbb5adbdf7aca89","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.1.tgz","fileCount":7,"integrity":"sha512-E6fEXLzf+rI1/tmWRO+Pyj5THGbxSpynhqZjUerz9E7wsnEp2uyWMUGzFAjjceQ5HyNEhFhUnscX41T+Nmg2gg==","signatures":[{"sig":"MEQCIFdXg6NCf+KNOZF1da8neUv9YmFOwdy0kjVZ8TtK03y9AiBSwm6ILGD0SxML/ciArchBWrDn3jojcMoYqqRUar7TXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6983},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"test":"asdgf","start":"nodemon dev.js"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"dependencies":{"es-module-lexer":"^0.9.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.1_1634549650782_0.6846588308850781","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.2","keywords":[],"author":{},"license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.2","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"dist":{"shasum":"1d9240491bfc6a3d4ebde6973f9ed6cd261d05fb","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.2.tgz","fileCount":7,"integrity":"sha512-T4mIuxPbun/i5IWN/q/VDW07cmeyJLWPcXQpOHVrf66aUpxfdxbjN1qZBlRXpo4TdQPKAJODbWTU3eVhy8HzAA==","signatures":[{"sig":"MEYCIQDmdhcCH5v56otaBEbqsBSU7jjw7FH/xYj9prbkfbU3BgIhAIfBhabLKvW62p7cf/7Ro75fNkNQYVBjYrujBTjj0nqf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9120},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"test":"asdgf","start":"nodemon dev.js"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"dependencies":{"es-module-lexer":"^0.9.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.2_1634721362649_0.9366027334754596","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.3","keywords":[],"author":{},"license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.3","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"dist":{"shasum":"5b5c0d313a167c45bdf640a488be5e3db4602b85","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.3.tgz","fileCount":7,"integrity":"sha512-LjaP8VQ36ijOKnCur/t1QjIjvkTvtjrhQhwjoY7iIobC1WVfw2Gd/XPyJomCcBA7HIW8nkaEl88++p11rZ22jg==","signatures":[{"sig":"MEYCIQDMjyZrHyKWKGZ6R+kkM0ZGQj1nPK5oxUx8QbDb5VNIvwIhAIS/FE8Lh94c/t3pIZ/BISKoj5EYGtUvzyTP4g/AC1Wt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9244},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"test":"asdgf","start":"nodemon dev.js","test:watch":"watchexec -w src -w test -w dev.js npm test"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"dependencies":{"es-module-lexer":"^0.9.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.3_1634807872971_0.7290442415179683","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.4","keywords":[],"author":{},"license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.4","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"dist":{"shasum":"986b3e4d7f3e83fe07a68d153c7e2953abc25bab","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.4.tgz","fileCount":7,"integrity":"sha512-D+ny//a4smbNl+USxXRw1V4sjJWBe/qG6ckVvAC+stTT2s3fVWYjXhILZnnWr4/y7dfAZXcYg4NQBIxN6QlfGA==","signatures":[{"sig":"MEQCIBss1PjsEqwqZsBSayZ9Al+ReNk1a91agJK3d0K5od37AiBc7l9JNj5jgsob5fXzSFdaRjsYLVCBWx7/xVrESPoE5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzeh3CRA9TVsSAnZWagAA13YP/jutAYt3h2Gqri2nPfF4\n2nMFUHIlG2vnmEdguWFBQZnokS9+ClBS4NQlgBpij1Xsxy804klkzW/w8NAz\nY2Pn3Z1NzNBNxPZcJ/8QIRl/yAHrxowUK4Znc3O8krR10oZ0G8QSwH75q6Xo\nah4p92xxo70NQbvU1wUh9Z9nFi3KEBCC7F9FHoWcyKj/TycT3xNH2JgJnhvQ\n7XIrJKUQdILIEePg2yRisNNCQhjpvftCX5uEwTmJd4B6Vokrg91oBEetHJ8n\n16XioSPP8e5hsj/+52FtNmDqOuGpT+d7l8gHUwGxDNiZpeuoo797vyHPPL1A\nS838hbzwnyJ02lTZPU+/NZRuqMAiHwlmTJihMJ6yEUO9BLHc+MhLQxohillw\nMkmzOLD3W6wliO3bsi3zT2alpnm3rxUPrXXCEEx57A+oXb2omeurOXMnO467\nefFlY+X/h+VyTPQ4FefyMCZwelYMun8Zt/y7kpyUjp8C5km8Gahmbr0Nw/4t\nD54BoDHx/jJ6/aKm4yHvnqz5tc4CXKjwtMbMAMh89KqMacqIrcKz6AHnHI+z\n56X7k2Tc6G2CVWIIS82BMyfLFSPBR0JYc7MIIuuo9ea5E2yGsA4elAdUy/yQ\nYSfijT5uVtetMDvvokpTwJ+6fdZDB4/sHCKaVvkS17/MJkOkGU92fQ1PpXTM\na402\r\n=w4S4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"test":"asdgf","start":"nodemon dev.js","test:watch":"watchexec -w src -w test -w dev.js npm test"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"dependencies":{"es-module-lexer":"^0.9.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.4_1634808941715_0.3439283064458716","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.5","keywords":[],"author":"","license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.5","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"dist":{"shasum":"ebc11672019de3d52bb8f29f76efe510b8401fbd","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.5.tgz","fileCount":5,"integrity":"sha512-fKIMMZCDFSoL2ySUoz8knWgpV4jpb0lUXgLOvdZQMQFHxgxz1PqOJpUIypwvEVyKk3nEHRY4f10gNol02HjeCg==","signatures":[{"sig":"MEUCID8jjTn3oot8w7rFh5kKWcvZASxkYgVtuv0Xak136ajuAiEA6kiajb2vRXU/JGWx7AVYfegWuQRBRFDcL9iBxTSwnTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijeAGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+qxAAmZ8kE26uvCAzntRDUYY4etkxWJJAN5g4M3oqsT4GDGFORI/7\r\nDXyhc+ULGOQGvAB1Dh1kV7YsELIuZ89ilIVKFy10YUZ3aU0u5jbdCoe/4jKt\r\nzZ5/M8p/d4NSjpTcKUNUSwxhRUGYqTbx71SReMO2mjysKJSOgmFWM6lmDl+E\r\nuTh5VoWK/tk5z2xmLrdcgElI9jVOiWK3rQHe6SWMCgZcFgu65k2xjJf4gJi3\r\ngMltuB5gdUlDPG/M+VbiG7YGOCoepmPjjNk+lX0EgqjKX8zAdd+XA60/PoyL\r\nhPbBin66T5aWVJYagN269bD8NgGxIcHrW3T6QwF/DYeZXfyOX95iPcxhleDc\r\nT7+gcOhSR16YU7MFb+NwyUVURZRoPMFJPE5uJZOjfTQFUJ+AX5kEdQgisplT\r\nmVCSM0Wf6rqT8IsI7CYog3cQm7Yk97rlNcpM5GZJ9Ll3fcEOGoOEMjzgIoO5\r\nmMo5keHeSrPeeb2WqWpXKSC8sGe0EWVv3scXTWqPpFMUwoTahsc9iWqGrFuR\r\nSNaqkwdl68QXYRQRN35KCsLKM4KQdW7UEc5qN45KLA3glknp7TKTEHavf01v\r\n/Siaq4r57uPxoqn0kOcBNF7rOwEPV5pjVifOo13wAjAZVI/BVKZT+0caL6IS\r\nKDw7xt8suZzVzmctvoZnj+QhL+z2CqOvyMI=\r\n=FG+b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"ea7523a5162ec1ce610da340ad7f77622a199548","scripts":{"test":"asdgf","start":"nodemon dev.js","test:watch":"watchexec -w src -w test -w dev.js npm test"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"_npmVersion":"8.3.0","description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"_nodeVersion":"16.10.0","dependencies":{"es-module-lexer":"^0.9.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.5_1653465093784_0.2402583718462874","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.6","keywords":[],"author":"","license":"ISC","_id":"@custom-elements-manifest/find-dependencies@0.0.6","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"homepage":"https://github.com/open-wc/custom-elements-manifest#readme","bugs":{"url":"https://github.com/open-wc/custom-elements-manifest/issues"},"dist":{"shasum":"1cc6efcc564a091ddacc3e1d2735447799f3093b","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.6.tgz","fileCount":5,"integrity":"sha512-2iVksJ156XuaeeC6jB6oMG6k9ROHS3W1delwJLL804yQMri9NnQW78JDCYMtFfW8b4locUG+3+hrtAHxk+fNGg==","signatures":[{"sig":"MEYCIQC0RuKnh4JaG8WkfbViivy2gcnVRwHOb0aquylivVGGLgIhAIQHOmqmIY6S4xpSziF4Q9fTvVI4LTphameHNR9SAZyM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12263},"main":"index.js","type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"384574f9fd050b0fcb5bc4da8eefa13adead3297","scripts":{"test":"asdgf","start":"nodemon dev.js","test:watch":"watchexec -w src -w test -w dev.js npm test"},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"repository":{"url":"git+https://github.com/open-wc/custom-elements-manifest.git","type":"git","directory":"packages/find-dependencies"},"_npmVersion":"11.3.0","description":"Given an array of paths, scans all modules and returns all depending paths.","directories":{},"_nodeVersion":"24.2.0","dependencies":{"rs-module-lexer":"^2.5.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/find-dependencies_0.0.6_1758095883224_0.5054167554770386","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@custom-elements-manifest/find-dependencies","version":"0.0.7","description":"Given an array of paths, scans all modules and returns all depending paths.","repository":{"type":"git","url":"git+https://github.com/open-wc/custom-elements-manifest.git","directory":"packages/find-dependencies"},"main":"index.js","scripts":{"start":"nodemon dev.js","test":"asdgf","test:watch":"watchexec -w src -w test -w dev.js npm test"},"type":"module","exports":{".":"./index.js","./package.json":"./package.json"},"keywords":[],"author":"","license":"ISC","dependencies":{"oxc-resolver":"^11.9.0","rs-module-lexer":"^2.5.1"},"_id":"@custom-elements-manifest/find-dependencies@0.0.7","gitHead":"caa11bed63292bdb3c3c480145ba803959ff0b9d","bugs":{"url":"https://github.com/open-wc/custom-elements-manifest/issues"},"homepage":"https://github.com/open-wc/custom-elements-manifest#readme","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-icHEBPHcOXSrpDOFkQhvM7vljEbqrEReW251RBxSzDctXzYWIL0Hk2yMDINn3d6mZ4KSsqLZlaFiGFp/2nn9rA==","shasum":"1aff55373a5c82349d560c0abc3b441285b066c1","tarball":"https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.7.tgz","fileCount":5,"unpackedSize":12593,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDtcxdCgZiF/ZUr4ugnx8bp3+lAoApAE8mEBl+Eny71AgIhAMvYz1i5IdfvYFXEVrvn81PjKXknxSQWHry5JGitqsCD"}]},"_npmUser":{"name":"passle","email":"pascalschilp@gmail.com"},"directories":{},"maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/find-dependencies_0.0.7_1762252534509_0.7122473923530275"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-18T09:34:10.728Z","modified":"2025-11-04T10:35:34.894Z","0.0.1":"2021-10-18T09:34:10.936Z","0.0.2":"2021-10-20T09:16:02.791Z","0.0.3":"2021-10-21T09:17:53.152Z","0.0.4":"2021-10-21T09:35:41.870Z","0.0.5":"2022-05-25T07:51:33.984Z","0.0.6":"2025-09-17T07:58:03.401Z","0.0.7":"2025-11-04T10:35:34.699Z"},"bugs":{"url":"https://github.com/open-wc/custom-elements-manifest/issues"},"license":"ISC","homepage":"https://github.com/open-wc/custom-elements-manifest#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/open-wc/custom-elements-manifest.git","directory":"packages/find-dependencies"},"description":"Given an array of paths, scans all modules and returns all depending paths.","maintainers":[{"name":"passle","email":"pascalschilp@gmail.com"}],"readme":"# find-dependencies\n\nGiven an array of paths, scans all modules and returns all depending paths.\n\nIntended to be used on post-build, frontend facing, ESM based code.\n\n## Usage\n\n```js\nimport { findDependencies } from '@custom-elements-manifest/find-dependencies';\n\nconst inputPaths = ['my-package/index.js'];\nconst dependencies = await findDependencies(inputPaths);\n```\n\nWhere `my-package/index.js` contains:\n\n```js\nimport '@scoped/package';\nimport {b} from '@scoped/package/baz/index.js';\nimport c from 'export-map';\nimport d from 'nested';\nimport e from 'regular';\nimport g from './bla.js';\nimport('dynamic-import');\n```\n\nWill output:\n\n```js\n[\n  '/Users/blank/my-package/node_modules/@scoped/package/index.js',\n  '/Users/blank/my-package/node_modules/@scoped/package/baz/index.js',\n  '/Users/blank/my-package/node_modules/export-map/long/path/index.js',\n  '/Users/blank/my-package/node_modules/nested/index.js',\n  '/Users/blank/my-package/node_modules/regular/index.js',\n  '/Users/blank/my-package/node_modules/dynamic-import/index.js',\n  '/Users/blank/my-package/node_modules/nested/node_modules/regular/index.js'\n]\n```\n\n## Configuration\n\n```ts\ninterface Options {\n  /**\n   * Module Resolution Options\n   *\n   * See [oxc-resolver](https://github.com/oxc-project/oxc-resolver) for more informations\n   */\n  resolutionOptions?: NapiResolveOptions,\n  /** Defaults to `process.cwd()` */\n  basePath?: string\n}\n```\n\n```js\nfindDependencies(inputPaths, {\n  basePath: 'foo/bar',\n  resolutionOptions: {\n    extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.d.ts', ''],\n    extensionAlias: {\n      '.js': ['.ts', '.js'],\n      '.jsx': ['.tsx', '.jsx']\n    },\n    mainFiles: ['index'],\n    mainFields: ['module', 'browser', 'main'],\n    conditionNames: ['import', 'require', 'node'],\n    exportsFields: ['exports'],\n    alias: {},\n    symlinks: true,\n    modules: ['node_modules']\n  },\n});\n```\n\n## Utils\n\n```js\nimport { \n  splitPath, \n  getUniquePackages, \n  extractPackageNameFromSpecifier, \n  isBareModuleSpecifier, \n  isScopedPackage \n} from '@custom-elements-manifest/find-dependencies';\n```\n\n\n### `splitPath`\n```js\nsplitPath('/blank/node_modules/foo/index.js');\n// {packageRoot: '/blank/node_modules/foo', packageName: 'foo', specifier: 'foo/index.js', type: 'js' }\n\nsplitPath('/blank/node_modules/foo/data.json');\n// {packageRoot: '/blank/node_modules/foo', packageName: 'foo', specifier: 'foo/data.json', type: 'json' }\n```\n\n### `extractPackageNameFromSpecifier`\n```js\nextractPackageNameFromSpecifier('foo/index.js') // foo\nextractPackageNameFromSpecifier('foo/bar/baz/index.js') // foo\nextractPackageNameFromSpecifier('@foo/bar/index.js') // @foo/bar\nextractPackageNameFromSpecifier('@foo/bar/baz/asdgf/index.js') // @foo/bar\n```\n### `isBareModuleSpecifier`\n```js\nisBareModuleSpecifier('foo') // true\nisBareModuleSpecifier('foo/bar.js') // true\nisBareModuleSpecifier('./foo.js') // false\nisBareModuleSpecifier('../foo.js') // false\n```\n### `isScopedPackage`\n```js\nisScopedPackage('foo') // false\nisScopedPackage('@foo/bar') // true\n```\n\n### `getUniquePackages`\n```js\ngetUniquePackages([\n  'blank/node_modules/foo/index.js', \n  'blank/node_modules/bar/index.js',\n  'blank/node_modules/bar/index2.js',\n  'blank/node_modules/bar/index3.js'\n])\n// ['foo', 'bar',]\n\n/** Or */\nconst dependencies = await findDependencies(inputPaths);\nconst unique = getUniquePackages(dependencies);\n```\n","readmeFilename":"README.md"}