{"_id":"import-global","_rev":"6777","name":"import-global","description":"Import a globally installed module","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T09:57:00.000Z","created":"2017-06-25T23:24:01.224Z","0.1.0":"2017-06-25T23:24:01.224Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-global.git"},"versions":{"0.1.0":{"name":"import-global","version":"0.1.0","description":"Import a globally installed module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-global.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["import","global","package","module","globally","npm","yarn","packages","require"],"dependencies":{"global-dirs":"^0.1.0"},"devDependencies":{"ava":"*","execa":"^0.7.0","xo":"*"},"gitHead":"ca7d20cea30691c1865f32b41c324a7e3b0d0ae2","bugs":{"url":"https://github.com/sindresorhus/import-global/issues"},"homepage":"https://github.com/sindresorhus/import-global#readme","_id":"import-global@0.1.0","_shasum":"97b38fd444114eec16824a935f8da575b57aa1ce","_from":".","_npmVersion":"4.6.1","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"97b38fd444114eec16824a935f8da575b57aa1ce","size":1790,"noattachment":false,"key":"/import-global/-/import-global-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-global/download/import-global-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-global-0.1.0.tgz_1498433040343_0.004843253409489989"},"directories":{},"publish_time":1498433041224,"_hasShrinkwrap":false,"_cnpm_publish_time":1498433041224}},"readme":"# import-global [![Build Status](https://travis-ci.org/sindresorhus/import-global.svg?branch=master)](https://travis-ci.org/sindresorhus/import-global)\n\n> Import a globally installed module\n\n**Please don't use this unless absolutely necessary. Local dependencies should be preferred.**\n\n\n## Install\n\n```\n$ npm install import-global\n```\n\n\n## Usage\n\n```\n$ npm install --global cat-names\n```\n\n```js\nconst importGlobal = require('import-global');\nconst catNames = importGlobal('cat-names');\n\ncatNames.random();\n//=> 'Snuggles'\n```\n\n\n## API\n\n### importGlobal(moduleId)\n\nThrows if the module can't be found.\n\n### importGlobal.silent(moduleId)\n\nReturns `null` instead of throwing if the module can't be found.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n\n## Related\n\n- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module\n- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally\n- [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/import-global#readme","bugs":{"url":"https://github.com/sindresorhus/import-global/issues"},"license":"MIT"}