{"name":"version-guard","version":"1.1.0","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 --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 install","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":"^14.18.22","@voxpelli/eslint-config":"^15.0.0","@voxpelli/tsconfig":"^4.0.0","eslint":"^8.20.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.4","eslint-plugin-promise":"^6.0.0","eslint-plugin-security":"^1.5.0","eslint-plugin-sort-destructure-keys":"^1.4.0","eslint-plugin-unicorn":"^43.0.1","husky":"^8.0.1","installed-check":"^6.0.3","npm-run-all2":"^6.0.1","type-coverage":"^2.22.0","typescript":"~4.6.0"},"gitHead":"2d99861d68c22d20edec9a39ac6374344e8f8a53","bugs":{"url":"https://github.com/voxpelli/version-guard/issues"},"_id":"version-guard@1.1.0","_nodeVersion":"16.15.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-UVKZCAfqsF+Lt7haseTdWIIIQm9wVATme1/2tz10cAJWCebN/zAQDMfneJ3e0wap6AUlqX5HHvJMVXtB8hBByw==","shasum":"17d7b00eefe6cefb46018f5de77384dd266d9054","tarball":"http://registry-npm.ywwl.com/version-guard/download/version-guard-1.1.0.tgz","fileCount":9,"unpackedSize":9192,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHt4ghab1cr+xECysgCzvVTlkb3yKv1ksgwpQUfhL536AiA97Z08XJ9RiCZ2i6kIU+9ddPhBGFFO1pwqOOuZIEW1Ow=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1HrRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrY2Q//encqsML6DLGFkvM8FMm9q80IjJ6B0cAhUF21lqWgmjt8vtLE\r\nMQbEXWZFBJVp7ZNVyRQYfSeCgvRCqSWjjABqdWKj/p9XLWUPmABO376s0wlu\r\nkDDvIJv3rRSiRTnXQUNz7GZG0bnHHd0LV9xH1u8K0/Lp2FZzr9r0kggkFZGW\r\naoQr2UbaZ+mJ1SC2eCQzL9G+6Wi3GesbxqcpT0npHPF9qrphZEsNkfMBlbOq\r\nMxD54zOYapF9BKoF1vt1h2rHECc1AV/Hz7PPI3qCK1PoJU/HzykCngPqrxT0\r\nNDHecsMpG2Mpjscp+WoMVkZR6TOCn+v3mbjB2TJq2W2UCEgi8LHHtHg44H3V\r\n4LBMKz/vEF5PFxwBVmDoO+SA3JQ5ryWzwr14B7LwEoAccorg1xxN5f0eHc1T\r\nbbYtLxTorhs3qXinp2x2QN6Jh2ISuNARiKWeCWwOHbaH5S+Y0O7oGeM/zjWq\r\nFTJEw4zJ8XljXt3nNboejocIwWBx81g4l7FJlaSz0ZRYbT3d4vcylhZyitb6\r\nXygIQn2JBh+4IefdmF9rjLHsvuBQOjF2S7UxQPwVlklxkwBqrqHm7/8eZ7K3\r\ntmHOvVjPyguvSb57yKSVTjXxq0zg0sROrwcpjPu1f5SSWjdw6jvD0LuU5N8t\r\n8PClOqSnrYagfYW2IhjgmxBmRy1atpaeohw=\r\n=Oz9I\r\n-----END PGP SIGNATURE-----\r\n","size":4053,"noattachment":false,"key":"/version-guard/-/version-guard-1.1.0.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.1.0_1658092241755_0.8434920447734504"},"_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":1658092241937,"_cnpm_publish_time":1658092241937,"dist-tags":{"latest":"1.1.3"}}