{"bugs":{"url":"https://github.com/sverweij/semver-try-require/issues"},"dist":{"shasum":"1396da65576444ef27fb5d6e61cc8cac72dc127b","tarball":"https://registry.npmjs.org/semver-try-require/-/semver-try-require-6.0.1-beta-1.tgz","fileCount":6,"integrity":"sha512-yIhOh3cYyoMOG/1GOKNzh3bBXdRa8tpgiR5Pe13fiQV5bTDOVV1kQYxNZNJdluD0fnH/p337uC14xhaF2Xk/XA==","signatures":[{"sig":"MEUCIAZ/qQ9c96LhdB3mMHyLK+jpD9zhA2P7RjjUa8VGZq5RAiEAxA+l2kI1K73BaJdI+Q8SJ9qGKPFA73VLpHgVjCetbG8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+gdmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAXg//UDzzZd+pXKKExb0ivYU4N3xkr+Gs1uda16E5SIA7avviGuS0\r\nrYFBJWpAzLK6/oUrNN8wEco6nQ/VlmVYFKMOlu/h3wpW2RfXia1s6mBbhlgJ\r\nhiNEQrjHclOrf7zBlS6VTAho3fCOHGy55i1DdwHo7fYeDJ1+CU0dJWHZpP06\r\na3WOVkUq85OCivovNEciC80vY715zcH2vI57M93pOso2pjZYh/JgJQ79LSA3\r\nmld7JTPYC8IuLKoKALIJUbc353tmQ9zbrcsh/Hm+neYmKeIflROuyHfg9cPz\r\ny7NX+fs0iRCRU4x1UQg4tq9EQzypy54YUpPHj3wjXvsy7kNkQt4VA5pRC2r8\r\nFnyQgYQ9wFPCsj58Hj6YDxSyePR8LAGCqT6BAqvTYO62gCM6FEG+UOcb2q+0\r\nsGqYuLYgHYRoPzm5C0DpzYdsFat1rk/rliRPkZp6qFaDY5dbsHtd0kKeirjH\r\nqrI3pjfTn5443DR1pmTeJJlzyscnv1F+8+p7TxKgXwsMXicTpfWqI9TvDtZQ\r\n+OAAEtuxXr1x0yxQl69zbGGQaYDc1OURRB25VU2FgFRayNGlTT3iIFbVFKGn\r\nnF4SsW4Nn+/rGFg5PBF9f/hjWPZ0hq8nnSJcDqIZLnc199mUKZlI7WP6GJoO\r\nuYbOe9rFUFDKAH6lohmVRUSMvisISpQl2Uc=\r\n=nN67\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"semver-try-require","type":"commonjs","types":"types/index.d.ts","author":{"url":"https://sverweij.github.io/","name":"Sander Verweij"},"readme":"## What's this then?\n\nA micro module that helps you require (versions of) modules\nthat might not be there.\n\nUseful to test for the availability of _optional_ and _peer_ dependencies\nbefore working with them.\n\n## Example\n\nSo you made the typescript compiler (v2) an optional dependency.\nBut you just want to keep running if it ain't there.\n\nDo this:\n\n```javascript\nconst tryRequire = require(\"semver-try-require\");\n\n// import typescript if there's a version >= 2 available\nconst typescript = tryRequire(\"typescript\", \">=2\");\n\n// now you can test if typescript is actually there\nconst lProgram = \"const cube = x => x*x*x; console.log(cube(42))\";\n\nif (typescript !== false) {\n  console.log(typescript.transpileModule(lProgram, {}).outputText);\n  // Result:\n  //   var cube = function (x) { return x * x * x; };\n  //   console.log(cube(42));\n} else {\n  // typescript >=2 not found - use fallback\n  console.log(lProgram);\n  // Result:\n  //    const cube = x => x*x*x; console.log(cube(42))\n}\n```\n\n## Signature\n\n### `pModulename`\n\nThe name of the module to resolve.\n\n### `pSemanticVersion`\n\nA semantic version (range). Optional.\n\n### return value\n\nThe (resolved) module identified by pModuleName if:\n\n- it is available, and\n- it satisfies the semantic version range specified by pSemVer\n\nreturns false in all other cases\n\n## History\n\nThis module started to try a few non-run-of-the-mill things with the\nnpm registry (deprecate, beta publishing, renaming). The tryRequire\nfunction in\n[dependency-cruiser ](https://github.com/sverweij/dependency-cruiser)\nseemed like a good candidate as it was not a thing that'd be unique\nto dependency-cruiser, and would probably be easier to maintain on its\nown anyway. I named it `tigerclaws-try-require` until I realized the\n_semver_ check was what distinguished it from the other try-require\nlike npm modules out there.\n\n[dependency-cruiser](https://github.com/sverweij/dependency-cruiser)\nnow uses semver-try-require in the [transpiler wrappers](https://github.com/sverweij/dependency-cruiser/tree/develop/src/extract/transpile)\nand it enables it to cruise typescript, coffeescript and livescript\ncode without having to ship the heavy duty compilers for these\nlanguages.\n\n## License\n\n[MIT](LICENSE)\n\n## Badge & flair section\n\n[![install, lint and test](https://github.com/sverweij/semver-try-require/actions/workflows/ci.yml/badge.svg)](https://github.com/sverweij/semver-try-require/actions/workflows/ci.yml)\n[![npm stable version](https://img.shields.io/npm/v/semver-try-require.svg)](https://npmjs.com/package/semver-try-require)\n[![total downloads on npm](https://img.shields.io/npm/dt/semver-try-require.svg?maxAge=2591999)](https://npmjs.com/package/semver-try-require)\n\nMade with :metal: in Holland\n","engines":{"node":"^14||^16||>=18"},"gitHead":"30268787e42e8540ce70d256c4abbf6071966bcf","license":"MIT","scripts":{"lint":"npm-run-all lint:eslint format:check","test":"c8 mocha --no-warnings","build":"npm-run-all build:clean build:compile","check":"npm-run-all --parallel lint test","format":"prettier --loglevel warn --write src types *.{md,yml,json}","version":"npm-run-all --sequential build lint scm:stage","lint:fix":"npm-run-all lint:fix:eslint format","scm:push":"run-p --aggregate-output scm:push:*","scm:stage":"git add .","check:full":"npm-run-all --parallel check check:outdated","build:clean":"rm -rf dist","lint:eslint":"eslint src","upem:update":"npm outdated --json --long | upem | pbcopy && pbpaste","format:check":"prettier --loglevel warn --check src types *.{md,yml,json}","upem:install":"npm install","build:compile":"tsc","upem-outdated":"npm outdated --json --long | upem --dry-run","check:outdated":"npm outdated","lint:fix:eslint":"eslint --fix src","scm:push:github":"run-p --aggregate-output scm:push:github:*","update-dependencies":"npm-run-all upem:update upem:install lint:fix build check","scm:push:github:tags":"git push --tags","scm:push:gitlab-mirror":"run-p --aggregate-output scm:push:gitlab-mirror:*","scm:push:github:commits":"git push","scm:push:gitlab-mirror:tags":"git push --tags gitlab-mirror","scm:push:gitlab-mirror:commits":"git push gitlab-mirror"},"_npmUser":{"name":"sverweij","email":"sander_verweij@yahoo.com"},"homepage":"https://github.com/sverweij/semver-try-require","keywords":[],"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/sverweij/semver-try-require.git","type":"git"},"_npmVersion":"9.2.0","description":"micro module to require (versions of) modules that might not be there","directories":{},"maintainers":[{"name":"sverweij","email":"sander_verweij@yahoo.com"},{"name":"foureightone","email":"foureightone@gmail.com"}],"_nodeVersion":"19.3.0","dependencies":{"semver":"^7.3.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"7.12.0","upem":"7.3.1","mocha":"10.1.0","eslint":"8.28.0","ts-node":"10.9.1","prettier":"2.7.1","typescript":"4.9.5","npm-run-all":"4.1.5","@types/mocha":"10.0.1","@types/semver":"7.3.13","eslint-plugin-node":"11.1.0","eslint-plugin-mocha":"10.1.0","eslint-plugin-import":"2.26.0","eslint-plugin-unicorn":"44.0.2","eslint-config-prettier":"8.5.0","eslint-plugin-security":"1.5.0","@typescript-eslint/parser":"5.53.0","eslint-plugin-budapestian":"5.0.1","eslint-config-moving-meadow":"4.0.2","eslint-plugin-eslint-comments":"3.2.0","@typescript-eslint/eslint-plugin":"5.53.0"},"_npmOperationalInternal":{"tmp":"tmp/semver-try-require_6.0.1-beta-1_1677330278321_0.10471635211063979","host":"s3://npm-registry-packages"},"_id":"semver-try-require@6.0.1-beta-1","version":"6.0.1-beta-1"}