{"name":"import-from","version":"3.0.0","description":"Import a module like with `require()` but from a given path","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-from.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["require","resolve","path","module","from","like","import","path"],"dependencies":{"resolve-from":"^5.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"fb039dcf3fe69bb3d395be4b5db2ab9367efcca7","bugs":{"url":"https://github.com/sindresorhus/import-from/issues"},"homepage":"https://github.com/sindresorhus/import-from#readme","_id":"import-from@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==","shasum":"055cfec38cd5a27d8057ca51376d7d3bf0891966","tarball":"http://registry-npm.ywwl.com/import-from/download/import-from-3.0.0.tgz","fileCount":5,"unpackedSize":5024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxC9KCRA9TVsSAnZWagAAIQgP/2QadK4xKtpUI/ZAhEWa\nx9EaePC/LYP+mMUK7/iQlfPlZZ3jI0JItnppqZO6Tc6Z2oC8cTHDzI7OlZCf\nU15NLwquFbMKkTKVYqTTB3d+Ol0cjR8bxD8KVlknBj6S/RA2FIXl1a8mbpce\n1V0p4LfRcxr4ANUwOUXJXdDDaCSnW136vgp4mdX0p1XhR8920cxDIKoQG/Ot\nAjA9b+c7uoA9ZhgC9fuvLlI3wGEIe6XuSEb8VKpr4Y8tayTgRXf+qFZoem/a\nbf/a23n/32Gr0s7ZbUi+Z7AMcpcTA/npyTHNs8HlGj2a7xMWrABpDchM2v4u\nHZsoi5cUfI448/WT3DsZQeqro0KOwq3cWxkI7Sn2lfejQRSIxiD9hGQC+fkI\npvC6fpTaFsxE9oLEVgtIOnXZoITqMvkiQQaL755oXURoZ49i1BQI/yv2vrDK\nlGz7ReVSecm4Ewh5Unjs7eWq05SIbK1I2I9Nso41Jp4SMMW6S1qaGG83Izu9\nEDWNddcsTwmeTcM5rG64UMaXHL/0cH+MPlZOFspGdhyzmrgBFSH9bjmZr2SM\n6IAD9pFLvlccXfzK2Gj/aidxpLAlHqiKQvQ/VrIFrvMiY0MeyDU5WrVrnPyH\nDdjEg/Jx4ydW6bZ+yb9cw12dzRcnhVwbNbvLbBRRAxfGy764et5aqUxCI7Ao\n2vA1\r\n=nZSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxUU4a/SUdMKTixF4WlQil82uPVNrE+F7Qy+Kmq1NEWQIhAOfD859mNbXImE8VOgTi+ecX3Hl8kXR2r5N7noZ+29hj"}],"size":2087,"noattachment":false,"key":"/import-from/-/import-from-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-from_3.0.0_1556361033390_0.7896283829815032"},"_hasShrinkwrap":false,"readme":"# import-from\n\n> Import a module like with [`require()`](https://nodejs.org/api/modules.html#modules_require_id) but from a given path\n\n## Install\n\n```\n$ npm install import-from\n```\n\n## Usage\n\n```js\nconst importFrom = require('import-from');\n\n// There is a file at `./foo/bar.js`\n\nimportFrom('foo', './bar');\n```\n\n## API\n\n### importFrom(fromDirectory, moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### importFrom.silent(fromDirectory, moduleId)\n\nReturns `undefined` instead of throwing when the module can't be found.\n\n#### fromDirectory\n\nType: `string`\n\nDirectory to import from.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n## Tip\n\nCreate a partial using a bound function if you want to import from the same `fromDir` multiple times:\n\n```js\nconst importFromFoo = importFrom.bind(null, 'foo');\n\nimportFromFoo('./bar');\nimportFromFoo('./baz');\n```\n\n## Related\n\n- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory\n- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point\n- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily\n- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module\n","publish_time":1556361033530,"_cnpm_publish_time":1556361033530,"dist-tags":{"latest":"4.0.0"}}