{"name":"import-from","version":"2.1.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","import","path"],"dependencies":{"resolve-from":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"c7d2eb8ebdb94873445632b2273d2d52030a7dc8","bugs":{"url":"https://github.com/sindresorhus/import-from/issues"},"homepage":"https://github.com/sindresorhus/import-from#readme","_id":"import-from@2.1.0","_shasum":"335db7f2a7affd53aaa471d4b8021dee36b7f3b1","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"335db7f2a7affd53aaa471d4b8021dee36b7f3b1","tarball":"http://registry-npm.ywwl.com/import-from/download/import-from-2.1.0.tgz","integrity":"sha512-0vdnLL2wSGnhlRmzHJAg5JHjt1l2vYhzJ7tNLGbeVg0fse56tpGaH0uzH+r9Slej+BSXXEHvBKDEnVSLLE9/+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLECENXt5o4ZzfZSXCW6em+kYLmV03ADDiKYqLOpR59AiEAtPMDuyBtXTQzCdrRPN/+RENs3t67ifQd/ujRWrVlP/s="}],"size":1863,"noattachment":false,"key":"/import-from/-/import-from-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-from-2.1.0.tgz_1495358911498_0.48687195940874517"},"directories":{},"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":1495358911839,"_cnpm_publish_time":1495358911839,"dist-tags":{"latest":"4.0.0"}}