{"name":"version-guard","version":"1.1.3","description":"Used to ensure modern CLI scripts fail silently on old js versions. Useful for static analysis tools and similar","homepage":"http://github.com/voxpelli/version-guard","repository":{"type":"git","url":"git://github.com/voxpelli/version-guard.git"},"main":"index.js","types":"index.d.ts","scripts":{"build:0":"run-s clean","build:1-declaration":"tsc -p declaration.tsconfig.json","build":"run-s build:*","check:installed-check":"installed-check --ignore-dev","check:lint":"eslint --report-unused-disable-directives .","check:tsc":"tsc","check:type-coverage":"type-coverage --detail --strict --at-least 95","check":"run-s clean && run-p check:*","clean:declarations":"rm -rf $(find . -maxdepth 2 -type f -name '*.d.ts*')","clean":"run-p clean:*","prepare":"husky","prepublishOnly":"run-s build","test-ci":"node test/run.js && node test/bin/run.js","test":"run-s check test-ci"},"keywords":[],"author":{"name":"Pelle Wessman","email":"pelle@kodfabrik.se","url":"http://kodfabrik.se/"},"license":"0BSD","engines":{"node":">=0.10.48"},"devDependencies":{"@types/node":"^18.19.50","@voxpelli/eslint-config":"^21.0.0","@voxpelli/tsconfig":"^13.0.0","eslint":"^9.9.1","husky":"^9.1.5","installed-check":"^9.3.0","npm-run-all2":"^6.2.2","type-coverage":"^2.29.1","typescript":"~5.5.4"},"_id":"version-guard@1.1.3","gitHead":"726fcc8abdf03fbd1aabd5ae0af0ca65fb2f63eb","bugs":{"url":"https://github.com/voxpelli/version-guard/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-JwPr6erhX53EWH/HCSzfy1tTFrtPXUe927wdM1jqBBeYp1OM+qPHjWbsvv6pIBduqdgxxS+ScfG7S28pzyr2DQ==","shasum":"5a39b9d195f94cb10d469553aa9951e1917da5d2","tarball":"http://registry-npm.ywwl.com/version-guard/download/version-guard-1.1.3.tgz","fileCount":9,"unpackedSize":9129,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjjjmKqVEtlxlN/7sA/BAcq8E7Bp++dKMMkDCw3qfJYgIgcEZNZqLA6t587Qxss+l3KkZl7pDIshHlufclSvLXwr8="}],"size":4073,"noattachment":false,"key":"/version-guard/-/version-guard-1.1.3.tgz"},"_npmUser":{"name":"voxpelli","email":"pelle@kodfabrik.se"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/version-guard_1.1.3_1725624537209_0.1545328307981262"},"_hasShrinkwrap":false,"readme":"# Version Guard\n\nUsed to ensure modern CLI scripts fail silently on old node.js versions\n\n[![npm version](https://img.shields.io/npm/v/version-guard.svg?style=flat)](https://www.npmjs.com/package/version-guard)\n[![npm downloads](https://img.shields.io/npm/dm/version-guard.svg?style=flat)](https://www.npmjs.com/package/version-guard)\n[![Types in JS](https://img.shields.io/badge/types_in_js-yes-brightgreen)](https://github.com/voxpelli/types-in-js)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-7fffff?style=flat&labelColor=ff80ff)](https://github.com/neostandard/neostandard)\n[![Follow @voxpelli@mastodon.social](https://img.shields.io/mastodon/follow/109247025527949675?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@voxpelli)\n\n## Usage\n\nAdd a top-level file to your project, eg. `cli.js`, containing something like:\n\n```javascript\nrequire('version-guard')('./path/to/file/to/run', 14, 18);\n```\n\n## Syntax\n\n`versionGuard(filePath, minMajor, [minMinor])`\n\n* **filePath** - a path to the modern file that should be run\n* **minMajor** - the lowest major Node.js version that should be allowed to run the file\n* **[minMinor]** - the lowest minor version of `minMajor` that should be allowed to run the file\n\nOn supported versions imports and runs `filePath` using the [dynamic `import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) (supporting both ESM and CJS modules).\n\nOn non-supported versions, fails silently with an error message.\n\nApart from checking current node version this command also looks up the main project's `package.json` and checks that the `engines.node` in it mentions the same version number as is sent to this command. To ensure that maintainers doesn't forget to update one of the two and thus the two diverging.\n\n## Notes\n\nThis project itself is a CJS project as the entire point is to work on incredibly old node.js versions.\n\n## Used by\n\n* [`installed-check`](https://www.npmjs.com/package/installed-check)\n* [`standard`](https://www.npmjs.com/package/standard)\n","publish_time":1725624537421,"maintainers":[{"name":"voxpelli","email":"pelle@kodfabrik.se"}],"_cnpm_publish_time":1725624537421,"dist-tags":{"latest":"1.1.3"}}