UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

107 lines (106 loc) 4.27 kB
{ "_args": [ [ { "raw": "import-from@2.1.0", "scope": null, "escapedName": "import-from", "name": "import-from", "rawSpec": "2.1.0", "spec": "2.1.0", "type": "version" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/supi" ] ], "_from": "import-from@2.1.0", "_id": "import-from@2.1.0", "_inCache": true, "_location": "/import-from", "_nodeVersion": "7.10.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-from-2.1.0.tgz_1495358911498_0.48687195940874517" }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "_npmVersion": "4.2.0", "_phantomChildren": {}, "_requested": { "raw": "import-from@2.1.0", "scope": null, "escapedName": "import-from", "name": "import-from", "rawSpec": "2.1.0", "spec": "2.1.0", "type": "version" }, "_requiredBy": [ "/supi" ], "_resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", "_shasum": "335db7f2a7affd53aaa471d4b8021dee36b7f3b1", "_shrinkwrap": null, "_spec": "import-from@2.1.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/supi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/import-from/issues" }, "dependencies": { "resolve-from": "^3.0.0" }, "description": "Import a module like with `require()` but from a given path", "devDependencies": { "ava": "*", "xo": "*" }, "directories": {}, "dist": { "shasum": "335db7f2a7affd53aaa471d4b8021dee36b7f3b1", "tarball": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz" }, "engines": { "node": ">=4" }, "files": [ "index.js" ], "gitHead": "c7d2eb8ebdb94873445632b2273d2d52030a7dc8", "homepage": "https://github.com/sindresorhus/import-from#readme", "keywords": [ "require", "resolve", "path", "module", "from", "like", "import", "path" ], "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "name": "import-from", "optionalDependencies": {}, "readme": "# import-from [![Build Status](https://travis-ci.org/sindresorhus/import-from.svg?branch=master)](https://travis-ci.org/sindresorhus/import-from)\n\n> Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from a given path\n\n\n## Install\n\n```\n$ npm install --save import-from\n```\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\n## API\n\n### importFrom(fromDir, moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### importFrom.silent(fromDir, moduleId)\n\nReturns `null` instead of throwing when the module can't be found.\n\n#### fromDir\n\nType: `string`\n\nDirectory to import from.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\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\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\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/import-from.git" }, "scripts": { "test": "xo && ava" }, "version": "2.1.0" }