{"name":"import-local","version":"3.1.0","description":"Let a globally installed package use a locally installed version of itself if available","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-local.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bin":{"import-local-fixture":"fixtures/cli.js"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"keywords":["import","local","require","resolve","global","version","prefer","cli"],"dependencies":{"pkg-dir":"^4.2.0","resolve-cwd":"^3.0.0"},"devDependencies":{"ava":"2.1.0","cpy":"^7.0.1","del":"^4.1.1","execa":"^2.0.1","xo":"^0.24.0"},"xo":{"ignores":["fixtures"]},"gitHead":"b45c5a6b68488da41b69ae6a8d2ef5edadb3de85","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@3.1.0","_nodeVersion":"12.22.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==","shasum":"b4479df8a5fd44f6cdce24070675676063c95cb4","tarball":"https://registry.npmmirror.com/import-local/-/import-local-3.1.0.tgz","fileCount":5,"unpackedSize":4658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1qWQCRA9TVsSAnZWagAAI64P/A68BPmdn13Da5Xxc5Sn\npl+wcrtmq1HIFW5AEf4R2yxgte++LDnx/tlQOhVPXZEJYEX/OgFqtA2M4eMy\ngg80P6eHFPm97fpS1IHqDPTLGwECFHZu+40Hy8g1z1BSpYHbWMe4fmBJm65A\nFHxMj6ffRd8FXLHU8US++vuosD3WVQ5tAes6wecw6vZLQP8s+f+XgYh0yHnq\nHFYNX+BSEKQ4MvLhdByr6OmWsLLqok4IM7+CI9hWFRzXmEo4JpkYae9Zx1Pf\nE7Cl1RtOoTHR/kaK7MPpO+zc/RuN0fdJCt9wPOas155CtJOcVArv8jMPAKif\nUuT0DoIo2sEGmGPI9WIztDU2VGkHOCuqiu8nisyqSoTh5xdunMh4vWDCy3pK\nlpqIsNfclzFUkYVZ/G/Du5FpF9KzfUY5zPzdK6MiFzM4QzF3RoUwXoD5kk3v\nXeBzB1NrGwkB04fwoCrYmKlfww9Xqo1DrP1Yceo3i2q02SwwYzm0ri7/apeO\nryM7xKJnZnZlsIiE7kgVHYB3tWFDsp32TifrUMMjOYTfPQGAdRZqrA2ApmQm\nGukWuds45dZWdYvFEqSij2PHM+eo2SvfFjgrn7hSPZkPpqweuIvMY50Clrdo\nuRURsmY0XzUGX9Cm5atfnyXNlomeFVDIPHHMua4m7kIFr6sOnNpnmF7k+Iq6\nlr+p\r\n=hCvS\r\n-----END PGP SIGNATURE-----\r\n","size":2392},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.1.0_1641457040443_0.08771197620841287"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-06T08:27:28.505Z","readme":"# import-local\n\n> Let a globally installed package use a locally installed version of itself if available\n\nUseful for CLI tools that want to defer to the user's locally installed version when available, but still work if it's not installed locally. For example, [AVA](https://avajs.dev) and [XO](https://github.com/xojs/xo) uses this method.\n\n## Install\n\n```sh\nnpm install import-local\n```\n\n## Usage\n\n```js\nimport importLocal from 'import-local';\n\nif (importLocal(import.meta.url)) {\n\tconsole.log('Using local version of this package');\n} else {\n\t// Code for both global and local version hereā¦\n}\n```\n\nYou can also pass in `__filename` when used in a CommonJS context.\n\n---\n\n