{"name":"import-global","version":"1.1.1","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":{"resolve-global":"^2.0.0"},"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","xo":"^0.56.0"},"ava":{"timeout":"10m"},"types":"./index.d.ts","gitHead":"f64def4d28628fe31ec1f6441cbc9961a48bd885","bugs":{"url":"https://github.com/sindresorhus/import-global/issues"},"homepage":"https://github.com/sindresorhus/import-global#readme","_id":"import-global@1.1.1","_nodeVersion":"21.5.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-xQ61Xy5435eLQUNYJoOS8bKBB1NP1K1HvurKNrQ8tcQolj5mGVxMaKYX+c8zoDiX2v1YjTlj3RgnBx3tPe5t7w==","shasum":"ae3ce4e90da8bd13c4305fe595ee2ff42ee419a9","tarball":"http://registry-npm.ywwl.com/import-global/download/import-global-1.1.1.tgz","fileCount":5,"unpackedSize":4603,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzqEGYPTx8Pfxk3UVL4wisQ0xFEJ1sCvKjXnclVOYwVwIgJ58t4+G361SakexxdV/FH/jPegmDA/U332WA4CDTHfI="}],"size":1945,"noattachment":false,"key":"/import-global/-/import-global-1.1.1.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.1.1_1704881172137_0.6499470303905881"},"_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":1704881172292,"_cnpm_publish_time":1704881172292,"dist-tags":{"latest":"1.1.1"}}