{"name":"externality","version":"1.0.2","repository":{"type":"git","url":"git+https://github.com/unjs/externality.git"},"license":"MIT","sideEffects":false,"exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"},"./*":"./*"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","dependencies":{"enhanced-resolve":"^5.14.1","mlly":"^1.3.0","pathe":"^1.1.1","ufo":"^1.1.2"},"devDependencies":{"@types/node":"^20.2.5","@vitest/coverage-c8":"^0.31.1","allowlist":"^0.1.1","c8":"^7.14.0","eslint":"^8.41.0","eslint-config-unjs":"^0.1.0","rollup":"^3.23.0","standard-version":"^9.3.2","typescript":"^5.1.3","unbuild":"^1.2.1","vite":"^4.3.9","vitest":"^0.31.4","webpack":"^5.85.0"},"build":{"externals":["rollup"]},"packageManager":"pnpm@8.6.1","scripts":{"build":"unbuild","dev":"vitest","lint":"eslint --ext .ts .","release":"pnpm test && standard-version && git push --follow-tags && pnpm publish","test":"pnpm lint && vitest run"},"description":"[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![Github Actions][github-actions-src]][github-actions-href] [![Codecov][codecov-src]][codecov-href] [![bundle][bundle-src]][bundle-href]","bugs":{"url":"https://github.com/unjs/externality/issues"},"homepage":"https://github.com/unjs/externality#readme","_id":"externality@1.0.2","_integrity":"sha512-LyExtJWKxtgVzmgtEHyQtLFpw1KFhQphF9nTG8TpAIVkiI/xQ3FJh75tRFLYl4hkn7BNIIdLJInuDAavX35pMw==","_resolved":"/private/var/folders/48/0bsggqvn049_nfcq7msw2njw0000gn/T/8a123cf3ac43d9916c51f1405697a9b0/externality-1.0.2.tgz","_from":"file:externality-1.0.2.tgz","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-LyExtJWKxtgVzmgtEHyQtLFpw1KFhQphF9nTG8TpAIVkiI/xQ3FJh75tRFLYl4hkn7BNIIdLJInuDAavX35pMw==","shasum":"a027f8cfd995c42fd35a8d794cfc224d4a5840c0","tarball":"http://registry-npm.ywwl.com/externality/download/externality-1.0.2.tgz","fileCount":7,"unpackedSize":20890,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmEf7cNFtyzNUxEfGqKX4Mi+2ITb23Wz7e1Dtv1bqR/AIgLlfTwWuKSFjCewd09V6VrVW4y/rKkNTAgJK/RkUSWlM="}],"size":4627,"noattachment":false,"key":"/externality/-/externality-1.0.2.tgz"},"_npmUser":{"name":"danielroe","email":"daniel@roe.dev"},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"},{"name":"danielroe","email":"daniel@roe.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/externality_1.0.2_1686048019592_0.4003204981391033"},"_hasShrinkwrap":false,"readme":"[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![Codecov][codecov-src]][codecov-href]\n[![bundle][bundle-src]][bundle-href]\n\n# Externality\n\nExternality is a set of utilities for handling identifying whether a given package or path should be considered an external package that can be imported at runtime, or whether is should be bundled in a build step.\n\nIt also contains a webpack and rollup plugin for encapsulating this functionality.\n\n## Install\n\nInstall using npm or yarn:\n\n```bash\nnpm i externality\n# or\nyarn add externality\n```\n\n## Rollup plugin\n\n```js\nimport { rollupExternals } from 'externality'\n```\n\n## Webpack plugin\n\n```js\nimport { webpackExternals } from 'externality'\n```\n\n## Utils\n\n### `resolveId`\n\nThis utility is powered by [`enhanced-resolve`](https://github.com/webpack/enhanced-resolve) and will resolve a given module/path with support for extensions, CJS/ESM and more.\n\n```js\nimport { resolveId } from 'externality'\n\nawait resolveId('my-lib', { type: 'commonjs' })\n// {\n//   id: 'my-lib',\n//   path: '/path/to/node_modules/my-lib/index.js',\n//   type: 'commonjs'\n// }\n```\n\n### `isExternal`\n\n```js\nimport { isExternal } from 'externality'\n\nawait isExternal('my-lib', '.')\n// {\n//   id: 'my-lib',\n//   external: true\n// }\n```\n\n## License\n\n[MIT](./LICENSE)\n\n<!-- Badges -->\n[npm-version-src]: https://img.shields.io/npm/v/externality?style=flat-square\n[npm-version-href]: https://npmjs.com/package/externality\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/externality?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/externality\n\n[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/externality/ci/main?style=flat-square\n[github-actions-href]: https://github.com/unjs/externality/actions?query=workflow%3Aci\n\n[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/externality/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/unjs/externality\n\n[bundle-src]: https://img.shields.io/bundlephobia/minzip/externality?style=flat-square\n[bundle-href]: https://bundlephobia.com/result?p=externality\n","publish_time":1686048019755,"_cnpm_publish_time":1686048019755,"dist-tags":{"latest":"1.0.2"}}