{"name":"version-guard","version":"1.0.2","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 --engine-no-dev","check:lint":"eslint .","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 install","prepublishOnly":"run-s build","test-ci":"node test/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":"^14.18.21","@voxpelli/eslint-config":"^14.1.0","@voxpelli/tsconfig":"^4.0.0","eslint":"^8.19.0","eslint-config-standard":"^17.0.0","eslint-plugin-es":"^4.1.0","eslint-plugin-import":"^2.26.0","eslint-plugin-jsdoc":"^39.3.3","eslint-plugin-mocha":"^10.0.5","eslint-plugin-n":"^15.2.3","eslint-plugin-promise":"^6.0.0","eslint-plugin-security":"^1.5.0","eslint-plugin-sort-destructure-keys":"^1.4.0","eslint-plugin-unicorn":"^42.0.0","husky":"^8.0.1","installed-check":"^6.0.1","npm-run-all2":"^6.0.1","type-coverage":"^2.21.2","typescript":"~4.6.0"},"gitHead":"bf3294fc408123abe84972a09d701957c4025354","bugs":{"url":"https://github.com/voxpelli/version-guard/issues"},"_id":"version-guard@1.0.2","_nodeVersion":"16.15.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-dKakS6IBfIvEvRjaDJYr9zeq3rZZg4GM5SXoqTq95P4SKVbkjXs8ks9uD8eACFSHS+oC7rVy9aUQryeWWgUDCA==","shasum":"bc0a1ee8f9e6d5b9be57362d1ea79fe3b5bd6efd","tarball":"http://registry-npm.ywwl.com/version-guard/download/version-guard-1.0.2.tgz","fileCount":9,"unpackedSize":8769,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/7OW7Gpyn45AzLqnmDkQ5X9zrxT9O/nx/dtB+eo879AiAtf77246hoblZKcI9RXV/2ds8AxGWE11m6LYnRqLon+A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiw0BMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonNw/5AD+6RLsIQnpxUgjaF9D20x5DvNWg0jjpdI1cBsjwrNGK4m/I\r\nm6JZWXTBBA4NXZG7P4uSKSeRMnIWUT+S4YjLNCB11fBWl5+LMIMa2uKs9xFp\r\nVqIIA8gCoR1+ctzFKQyi2B7zrQkQ7bwwJDWHU2AwHGJXpMMUDSTVOLnk0Kjo\r\nuBL46F8eLiq6ddHSWiO3QN/QGHh9AvOsyC6A0l4Ki5MHlOk1ixpZxPKBkhNN\r\nAQzz52e4ia5EoTgqhZ0E7KAvgojFFb6Zeq6xpaMAObyo3eKzWP6FXIvFwr/C\r\nMtC6G4UzmOQkE01NytOlUBSE56ZOqZtvtSFTtJ/G6p3AYT/xFtb/pHdkNwId\r\n0UXPSK9LNP9FdecRtsabSNkDLZvjsEWHoPYx3fd9MmPY313Zx7FDHvQ1HrZZ\r\n+SVeobO7rihfG9fak9kMiVEeFxQCv5rj7XtsOLC5pLwzBSsRtQerYvBgTI7T\r\n9uDA3C5yc8qZhuJOwZHfGEC4eyvC296drE9hgXn4uaZHH4t0mz41jRn56m7Y\r\nJF2knC8Z1IkhoBOXDphFg+O8yDndAUdUNfSo+UbxVIVqtcFDULXPvMvIC+bj\r\njhTtFx5e8LFeWhtMMy7rWyuPME4X2pgll+WizFJw4wNqopBz0nOOyLsQZAbn\r\ngUyiQlAvGXVcyjRzMnoxDoI7Qp0hPEJE9z8=\r\n=7WRx\r\n-----END PGP SIGNATURE-----\r\n","size":3857,"noattachment":false,"key":"/version-guard/-/version-guard-1.0.2.tgz"},"_npmUser":{"name":"voxpelli","email":"pelle@kodfabrik.se"},"directories":{},"maintainers":[{"name":"voxpelli","email":"pelle@kodfabrik.se"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/version-guard_1.0.2_1656963148507_0.4691524725241274"},"_hasShrinkwrap":false,"readme":"# Version Guard\n\nUsed to ensure modern CLI scripts fail silently on old node.js versions\n\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/voxpelli/eslint-config)\n[![ES Module Ready Badge](https://img.shields.io/badge/es%20module%20ready-yes-success.svg)](https://esmodules.dev/)\n[![Types in JS](https://img.shields.io/badge/types_in_js-yes-brightgreen)](https://github.com/voxpelli/types-in-js)\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* [`dependency-check`](https://www.npmjs.com/package/dependency-check) - _in progress_\n* [`installed-check`](https://www.npmjs.com/package/installed-check) - _in progress_\n","publish_time":1656963148684,"_cnpm_publish_time":1656963148684,"dist-tags":{"latest":"1.1.3"}}