{"name":"import-global","version":"1.0.0","description":"Import a globally installed module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-global.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["import","global","package","module","globally","npm","yarn","packages","require"],"dependencies":{"global-directory":"^4.0.1"},"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","xo":"^0.56.0"},"gitHead":"c63885c3eb162cef40adc8a0d880ae23d1ce2cb8","bugs":{"url":"https://github.com/sindresorhus/import-global/issues"},"homepage":"https://github.com/sindresorhus/import-global#readme","_id":"import-global@1.0.0","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-vaG8Q8oNY/7d2SA+IHu6h7h2bEv6+DrEVsTGWPSBW3HFWAzWNy4Qi5OO9yGPsgSCFol477gXk6eaocheOE44Zw==","shasum":"9e87ad060a74daa871b4c180f6f99dfafc15508f","tarball":"http://registry-npm.ywwl.com/import-global/download/import-global-1.0.0.tgz","fileCount":4,"unpackedSize":3756,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/HyANAxBAGsXGcC/s6Do9tejMN7y4ijoNN8HOKlDkjAIhAJcSl1Z0tvHdov04hd7OLmX0Ku1T0jQymCR8gnW1KPcf"}],"size":1875,"noattachment":false,"key":"/import-global/-/import-global-1.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-global_1.0.0_1699293818110_0.27971905670480535"},"_hasShrinkwrap":false,"readme":"# 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## Install\n\n```sh\nnpm install import-global\n```\n\n## Usage\n\n```sh\nnpm install --global cat-names\n```\n\n```js\nimport {importGlobal} from 'import-global';\n\nconst {default: catNames} = await importGlobal('cat-names');\n\ncatNames.random();\n//=> 'Snuggles'\n```\n\n## API\n\n### importGlobal(moduleName)\n\nThrows if the module cannot be found.\n\n### importGlobalSilent(moduleName)\n\nReturns `undefined` instead of throwing if the module cannot be found.\n\n#### moduleName\n\nType: `string`\n\nWhat you would use in [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).\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-directory](https://github.com/sindresorhus/global-directory) - Get the directory of globally installed packages and binaries\n","publish_time":1699293818272,"_cnpm_publish_time":1699293818272,"dist-tags":{"latest":"1.1.1"}}