{"name":"version-guard","version":"1.0.1","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:run":"node test/run.js","test-ci":"run-s test:*","test":"run-s check test:*"},"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":"acf0a5a8dccc7c55ca3fa2f54ad22602c8c8dc9e","bugs":{"url":"https://github.com/voxpelli/version-guard/issues"},"_id":"version-guard@1.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-d+mNOnB7XG5os891KZFzpVptq6qKZwDK3bWx6IBhWHwBmv9WX5B+IsjADwvjnf4YtRTkbuZLktqKh/qXX0PkcA==","shasum":"8f1de16850bafc1823cadc69b3b105119eb8129f","tarball":"http://registry-npm.ywwl.com/version-guard/download/version-guard-1.0.1.tgz","fileCount":9,"unpackedSize":8614,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEfLDgDmurj0lGfEAQTTqgFCAho2olQOfPkmDA3c9tWAiEA+UsHLo1uGPNkwwavGQu3gQS5+XLAC+1Dt0nZC7xOEWw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwyypACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBmA/+OxCg3Lamrpg1/hJj5fnV5ZGjw1/BNC6qvKKv3MFwFRKsPuHe\r\nHrTXnWnDKe8pfsZExjTxtSTHPbnDw0fqnimPXuClr96LEpPnULozdLhl4UhP\r\n9/yIOo1hSkBk29ziSbBXmlkol3Ah9MzJCI88FoVtzh9P48dtPs9dbOdRp+HI\r\nuJUdL2dts6Uh9QbJtpaFz0et+FqXBY4Eaj0NB/w8EEF6vVpPOcAWaXErK9Ug\r\nir2koxmwYkFss+T9QDn2+CJt2SaGGCvMuBgL1VggFH1LAUw6DVvK/0f4XVfk\r\nBL1Wu+4hwQosUBmcxzno1vTZku+azms8CU8IFt56TqA8ydvRFmTi5mb1jg6W\r\nYjwZ48bKiqg51tUhl+tcRQAhTq2INlR+RrCu0Jn7HTGCK2SmpYeOnXP2jzi8\r\nS9OUyCoIrTIcSZdNfh8KDvHtYOmipmyzp73mZXp49GUjIuMrg+rZIeUi5NlC\r\ng8GGok/zFSAZUfjxrvASHiGX576E6xUjezMW2Cjpj3bJz5wQ404jmo7cRTYM\r\ntagihDdDd75FHz8RMLLNc6G7CsfvrcQY69VzQTRwLakX5E1HnfXHYjnLp/DP\r\nC1f8prK0t9/0varVoJEFVj+73d++hUM0EHNw8fzTtSqjpKB4spqHPD7Ch6g/\r\nn8KLOXowZouUUlUJd5aQPn6SeMZ0cpsiNHU=\r\n=g0MH\r\n-----END PGP SIGNATURE-----\r\n","size":3787,"noattachment":false,"key":"/version-guard/-/version-guard-1.0.1.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.1_1656958121540_0.324020775579261"},"_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":1656958121669,"_cnpm_publish_time":1656958121669,"dist-tags":{"latest":"1.1.3"}}