{"_id":"import-local","_rev":"3441943","name":"import-local","description":"Let a globally installed package use a locally installed version of itself if available","dist-tags":{"latest":"3.2.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-08-27T19:25:44.000Z","created":"2017-05-04T17:59:50.343Z","3.2.0":"2024-07-22T10:56:48.659Z","3.1.0":"2022-01-06T08:17:20.570Z","3.0.3":"2021-10-04T06:01:21.422Z","3.0.2":"2019-07-24T06:33:34.846Z","3.0.1":"2019-07-07T13:53:47.456Z","3.0.0":"2019-06-29T18:58:54.926Z","2.0.0":"2018-08-31T19:40:47.407Z","1.0.0":"2017-12-15T10:18:01.261Z","0.1.1":"2017-05-06T09:38:35.003Z","0.1.0":"2017-05-04T17:59:50.343Z"},"users":{"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-local.git"},"versions":{"3.2.0":{"name":"import-local","version":"3.2.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"},"sideEffects":false,"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"]},"_id":"import-local@3.2.0","gitHead":"ff3fb1541a40b629a22d2d21a4e1cf4605c6bb5a","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_nodeVersion":"20.12.2","_npmVersion":"10.6.0","dist":{"shasum":"c3d5c745798c02a6f8b897726aba5100186ee260","size":2337,"noattachment":false,"key":"/import-local/-/import-local-3.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.2.0_1721645808498_0.8746776811717698"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-22T10:56:48.659Z","publish_time":1721645808659,"_source_registry_name":"default","_cnpm_publish_time":1721645808659},"3.1.0":{"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":{"shasum":"b4479df8a5fd44f6cdce24070675676063c95cb4","size":2392,"noattachment":false,"key":"/import-local/-/import-local-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_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","publish_time":1641457040570,"_cnpm_publish_time":1641457040570},"3.0.3":{"name":"import-local","version":"3.0.3","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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"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":"87e1ced6b9c2d723150ed9f3914954c44552339d","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@3.0.3","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"shasum":"4d51c2c495ca9393da259ec66b62e022920211e0","size":2260,"noattachment":false,"key":"/import-local/-/import-local-3.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.0.3.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.0.3_1633327281290_0.7959688664482825"},"_hasShrinkwrap":false,"publish_time":1633327281422,"_cnpm_publish_time":1633327281422},"3.0.2":{"name":"import-local","version":"3.0.2","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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"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":"101c4517c940f65799db1fb4de1d178f4c5b7b08","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@3.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a8cfd0431d1de4a2199703d003e3e62364fa6db6","size":2199,"noattachment":false,"key":"/import-local/-/import-local-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.0.2_1563950014712_0.05855547209453382"},"_hasShrinkwrap":false,"publish_time":1563950014846,"_cnpm_publish_time":1563950014846},"3.0.1":{"name":"import-local","version":"3.0.1","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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"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":"3b6d85bea895f8ef3acad55e7fb7d06a4d77a2aa","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@3.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0b0f61a207b6c6b005c931dc72951ddde8303713","size":2071,"noattachment":false,"key":"/import-local/-/import-local-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.0.1_1562507627368_0.3233282122265466"},"_hasShrinkwrap":false,"publish_time":1562507627456,"_cnpm_publish_time":1562507627456},"3.0.0":{"name":"import-local","version":"3.0.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"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":{"find-up":"^4.1.0","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":"77bc808f6fb2d11fc79b95dbcda06c0e1d3ef10c","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@3.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ce45eb1528ac8fb921c99df7421326b8ee46c638","size":2096,"noattachment":false,"key":"/import-local/-/import-local-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_3.0.0_1561834734792_0.16239590100067613"},"_hasShrinkwrap":false,"publish_time":1561834734926,"_cnpm_publish_time":1561834734926},"2.0.0":{"name":"import-local","version":"2.0.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"import-local-fixture":"fixtures/cli.js"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["import","local","require","resolve","global","version","prefer","cli"],"dependencies":{"pkg-dir":"^3.0.0","resolve-cwd":"^2.0.0"},"devDependencies":{"ava":"*","cpy":"^7.0.1","del":"^3.0.0","execa":"^0.11.0","xo":"*"},"xo":{"ignores":["fixtures"]},"gitHead":"ca0a08fe9b9072a73294a875e93970ac0634f452","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"55070be38a5993cf18ef6db7e961f5bee5c5a09d","size":1964,"noattachment":false,"key":"/import-local/-/import-local-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local_2.0.0_1535744447258_0.3296999336977211"},"_hasShrinkwrap":false,"publish_time":1535744447407,"_cnpm_publish_time":1535744447407},"1.0.0":{"name":"import-local","version":"1.0.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"import-local-fixture":"fixtures/cli.js"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js","fixtures/cli.js"],"keywords":["import","local","require","resolve","global","version","prefer","cli"],"dependencies":{"pkg-dir":"^2.0.0","resolve-cwd":"^2.0.0"},"devDependencies":{"ava":"*","cpy":"^6.0.0","del":"^3.0.0","execa":"^0.8.0","xo":"*"},"gitHead":"b3a40b30273907ddcf53d7c9df9687ef02d5d6dc","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5e4ffdc03f4fe6c009c6729beb29631c2f8227bc","size":1937,"noattachment":false,"key":"/import-local/-/import-local-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-local-1.0.0.tgz_1513333080491_0.8174301576800644"},"directories":{},"publish_time":1513333081261,"_cnpm_publish_time":1513333081261,"_hasShrinkwrap":false},"0.1.1":{"name":"import-local","version":"0.1.1","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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"import-local-fixture":"fixtures/cli.js"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js","fixtures/cli.js"],"keywords":["import","local","require","resolve","global","version","prefer","cli"],"dependencies":{"pkg-dir":"^2.0.0","resolve-cwd":"^2.0.0"},"devDependencies":{"ava":"*","cpy":"^5.0.0","del":"^2.2.2","execa":"^0.6.3","xo":"*"},"gitHead":"05e7e5d29ee3eec3a5ec535db802b9906f27afd9","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@0.1.1","_shasum":"b1179572aacdc11c6a91009fb430dbcab5f668a8","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b1179572aacdc11c6a91009fb430dbcab5f668a8","size":1975,"noattachment":false,"key":"/import-local/-/import-local-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-0.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/import-local-0.1.1.tgz_1494063512345_0.08312201895751059"},"directories":{},"publish_time":1494063515003,"_hasShrinkwrap":false,"_cnpm_publish_time":1494063515003},"0.1.0":{"name":"import-local","version":"0.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"import-local-fixture":"fixtures/cli.js"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["import","local","require","resolve","global","version","prefer","cli"],"dependencies":{"pkg-dir":"^2.0.0","resolve-cwd":"^2.0.0"},"devDependencies":{"ava":"*","cpy":"^5.0.0","del":"^2.2.2","execa":"^0.6.3","xo":"*"},"gitHead":"87a0c91a9a0ecea64471a95479b0366af296b989","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"homepage":"https://github.com/sindresorhus/import-local#readme","_id":"import-local@0.1.0","_shasum":"f6575ffbcd6bac3953def94ac91d12db2d603f67","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f6575ffbcd6bac3953def94ac91d12db2d603f67","size":1894,"noattachment":false,"key":"/import-local/-/import-local-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-local/download/import-local-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/import-local-0.1.0.tgz_1493920790095_0.707845498342067"},"directories":{},"publish_time":1493920790343,"_hasShrinkwrap":false,"_cnpm_publish_time":1493920790343}},"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","_attachments":{},"homepage":"https://github.com/sindresorhus/import-local#readme","bugs":{"url":"https://github.com/sindresorhus/import-local/issues"},"license":"MIT"}