{ "_id": "import-local", "_rev": "7-86a46d35357ff72ba88f7cb2c02521b5", "name": "import-local", "description": "Let a globally installed package use a locally installed version of itself if available", "dist-tags": { "latest": "3.0.2" }, "versions": { "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", "tarball": "https://registry.npmjs.org/import-local/-/import-local-0.1.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/import-local-0.1.0.tgz_1493920790095_0.707845498342067" }, "directories": {} }, "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", "tarball": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/import-local-0.1.1.tgz_1494063512345_0.08312201895751059" }, "directories": {} }, "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": { "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", "shasum": "5e4ffdc03f4fe6c009c6729beb29631c2f8227bc", "tarball": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-local-1.0.0.tgz_1513333080491_0.8174301576800644" }, "directories": {} }, "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": { "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", "shasum": "55070be38a5993cf18ef6db7e961f5bee5c5a09d", "tarball": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", "fileCount": 5, "unpackedSize": 3598, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiZm/CRA9TVsSAnZWagAAqVoP/RvjCV9n5/YWAsXKXbdG\np3O+2MMA2dGA/UiXKus70KivRpQayAwCSw94LJkCESOA79zXYKfovzi4MJFE\nUlUwgZRD1/aeV+ujYHMaOTGjcMF1BAxm0xWLTcTq/HDKoN5ETdqGQMW6quou\nFHK5HJk6w2ZeBQD9+qd482nWyW1HbapuD2MpTZAWlTgc9LUj4jETPZ3LgcXd\nVSyQ8CA52FuLT7/LqXQ/DvXQQpKDx+LRfHP1iJASigOemJqvkFbLzciirm79\naf/F8a+YTh8z90fP9Zyo4mcA3OqwRCvDq8+/Ls3ZuKnbdofKmfjcM+s53YBl\nS5GVR0DfJA85Pv8sO0+/dRA/JDDHyy+vcmgYBCvTs6muSVk9eoMbBYs5PXpK\nMh/tSvNPuUD1/LLmE+tVvQ9NuriEQboH8WfmLUhQPZbtvBS4VunyddTNnMf7\nA6SVQjkHxwh5DR1gDFmc0k8jTnb50Vi1HnnTMz6tjrAz9WG0b0zhffpcfGRw\nTZ/D3DXSxvqLOqIfYHrl5c5wKgvS0+7Ed0TXR0lg8iwG+iavlOlTqvIz0jwO\nkugY+d+zJcGh9RHOIaNtduroB5nXAUTRPm0DyPvh3NfzhQJnFHTm8EMwEeSz\nRYZqMMO9PJKK+mdUTMNiU9M2wp4sAVSpT9XZIHCl560nDQfbQq0gRMh9v3CR\nQ8wF\r\n=BXgL\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-local_2.0.0_1535744447258_0.3296999336977211" }, "_hasShrinkwrap": false }, "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": { "integrity": "sha512-8Uh3mLtqDxb3jUxHRev+qSdJbSe7RD0avbWM36kHj87KwCTIXdM7b/OfmwrJKjIVcSBK4w1XL5YCatdfV10e3A==", "shasum": "ce45eb1528ac8fb921c99df7421326b8ee46c638", "tarball": "https://registry.npmjs.org/import-local/-/import-local-3.0.0.tgz", "fileCount": 5, "unpackedSize": 3931, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdF7TvCRA9TVsSAnZWagAAhbQP/3I4U2dV+MjCKi5CqK3c\n13VOU71q9/58b8j8p/ewDdQ/Qz9Ie7lsqgViddmkeozJRuNk3mc6gM039pvb\nRbn2xacYzhXe4063K5yu3IgHFlZmdMnlNdngiQzsyvmNPoNewQlsXHPUircV\nremSXJkY3JdaebmXxGcjZlN/XObwVXGYJ4lWvD+jqZHPMsL56IaihqZ3DZ10\nLYD9Ii8/oLsdWQmVspthR0sSJuBZMiI21q7qDWvKth7Go/jnUMVJMZw+6Dn6\n9ksVI/DvJrLHN6cH4YMeP9bq7eCvqeRhVZ66acnk/rtqDwXBWCu2lx81zvah\nM9dOEr/Rhbf5dWVQEiBdG0gGFV7ELgBIgPSuGX9R867IYLpks5nmoBZxfsZK\n+jH2IE/0wqOUQunP8h5Fa9hFZmItHp6aFRItMiqaVc5yLRkzyJcFdorxb3Kn\nICsx5ubKu3QrPw20lXUVt5c7NL+MM9Dj0aAYQFXOlb880awrZqTNsxiJllc3\nXbj734ygRLNxFn11SMNspIs4dtaDGu5Xwcte8+9KBkyOcB2NvlWQ7MtDsxrF\nIl/NfI3RKsMrLjCbOflZFeya9AzENrj3g32HHiodAEykF/4DBK1pdnLS8Y4/\nRrKJto/HUEaSA5a0iMGi36sbo8SMJXing82Ppb78M5emVwUAy7c/iJSZYh0Z\nYyka\r\n=eHQk\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-local_3.0.0_1561834734792_0.16239590100067613" }, "_hasShrinkwrap": false }, "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": { "integrity": "sha512-XlabwTJ9tPOdyjnGdGvxUMnUhmhlnJhdYjp5e8UDb2fO+5Gto1Frlg66ixVAf1Os+zQlrKt3QlTCVodyxYBZjQ==", "shasum": "0b0f61a207b6c6b005c931dc72951ddde8303713", "tarball": "https://registry.npmjs.org/import-local/-/import-local-3.0.1.tgz", "fileCount": 5, "unpackedSize": 3918, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIflsCRA9TVsSAnZWagAAQa8P/3YWYA83dfLiUkHGLzsn\naAfz3W/FIKciazvy/9UYxqBQoECCNAvCdP6DuSShRAPaPC9OuLDODA/5KX4D\n/0hqVlqs9lW5IlgX7wbaX673/ny77mCPte/OvgwNAEbhhhOZ1ilUpUA8TXyM\njaYfDJy40SHDToll3hGu+KHKcLv9BV8JidZ5bVItgw+Gd1RZPnnOLgubU6RB\nAUlLoZPmraNMZpo6iIMP5mR3GegeMFVM9I0AJ5SqAM53fIs4geMV1G1jAPuA\nJ5FJrGa1r2fgX8bs9Gic1Y9VqMLtkMp7zFPt/4o4jKYC1oIqneM+PC8z1b/3\n4txunpp1QA92jtJEaTgbLVNh7IUOBn1DIH0lF5ZgsEUNk3m6ebxM1qekF1op\nq7rw2GZijicF4Vf+rp1nmiPCSgzrCI7IUmUmzUID0Oz0pzoaoqaK/NwJvxv8\nZkwcUAfYCG4f6+OltzFMlL7am1/Mh/ScvoB6iz8pSooSUczU0cPS6ERLq1T/\nd5tw3iqEePz9KloQtfPTWZiYCAZhxHGlZc77UfaKWRqCaJ5uVxUYo9kygU76\n6tJ/+SZgyXi6UVF6Z+IIQcLBDvLJI1JamX3aJkD0brKCbOH0WzubfWAds8do\nyqgPmJ3Pxy4X6KongXNTssIkBntJtq5XRbu2x2H8VC4cHCpdjRMc9LA/oFAb\nyYTp\r\n=fE+4\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-local_3.0.1_1562507627368_0.3233282122265466" }, "_hasShrinkwrap": false }, "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": { "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", "shasum": "a8cfd0431d1de4a2199703d003e3e62364fa6db6", "tarball": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", "fileCount": 5, "unpackedSize": 4177, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdN/u/CRA9TVsSAnZWagAA9IcP/iryGyKb6ZbQFewtzAO5\nPhTg6bBjk4EL4DwpXhWfKA30KsGC0RY3ki0hALG7tMY3PiV5iZmMuQKE+PHp\nOZzAGrNoNxju+DI9UwYKToyHElARd0fl3uPTmWl5kUmKzea7qpTmmKxC6Z/w\n4oizotszrJOqW40bNVRyU7KKutfyRxn2NdSJaYLpJU0RbzN/HFfpS+RngYGf\nVbgV4mcSiXjZmtOYkhuQl+8GHx1KDQSPOsFj3kB1UYaq8t4zqxl/NPsS9TxE\nVuJF2/noa/Wi5IT30+9iJTTy2fVA0tH+H15HqzLROUdJUs+wt6XZUrfOGC9i\n2bpOAHEp/CdpTXprzEMt603vioiuZApZIOVp+JvCAcMnG2b5q1ekVf94xXw9\nPDmBZp9q2QjGwoZ/zB3g3/NBgulR0OyhsTk8AROzoj96FDmeveBSksfHV7fD\n+IG+z1z/bP1lc8TxTKkI2nKhAINXGGXrptZoVncX6hBjpAYf445dL0abqcMt\n5FwjOT5gcSWx4r8DdDozOUHrlLOjQuaf5LKpzoe3ysVut4quUkKNehz7/ykN\n1NsAwXTy7aXGZKT3XLz8LuDHpYr68mQrLSK8W43ArkQt9BwFqxFosNRlLQKi\nRJE61AqHH4M6Ixc43Gir+Sys0jL49SSIRPECdWz6f5Eg/h7LDQcNdpD9VXmT\nJJ6v\r\n=/aKs\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-local_3.0.2_1563950014712_0.05855547209453382" }, "_hasShrinkwrap": false } }, "readme": "# import-local [](https://travis-ci.org/sindresorhus/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](http://ava.li) and [XO](https://github.com/xojs/xo) uses this method.\n\n\n## Install\n\n```\n$ npm install import-local\n```\n\n\n## Usage\n\n```js\nconst importLocal = require('import-local');\n\nif (importLocal(__filename)) {\n\tconsole.log('Using local version of this package');\n} else {\n\t// Code for both global and local version hereā¦\n}\n```\n\n\n---\n\n