{"_id":"if-node-version","_rev":"7-92e4ed7a36f623200f53eb30e5028edf","name":"if-node-version","description":"Run commands if on specified node version.","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.0":{"name":"if-node-version","version":"0.0.0","description":"Run commands if on specified node version.","engines":{"node":">=0.10.0"},"main":"lib/index.js","bin":{"if-node-version":"bin/index.js"},"files":["bin","lib"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{"cross-spawn":"^4.0.0","semver":"^5.2.0"},"devDependencies":{"eslint":"^2.13.1","eslint-config-mysticatea":"^4.0.0"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"keywords":[],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"homepage":"https://github.com/mysticatea/if-node-version#readme","gitHead":"34cb764b9d2c88cd882032c7e7713e59359bea93","_id":"if-node-version@0.0.0","_shasum":"eb08bb93c3540f05a050b61fcd9537e0ccacc60b","_from":".","_npmVersion":"3.9.0","_nodeVersion":"4.4.7","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"shasum":"eb08bb93c3540f05a050b61fcd9537e0ccacc60b","tarball":"https://registry.npmjs.org/if-node-version/-/if-node-version-0.0.0.tgz","integrity":"sha512-5Vhj6+FkNgUOch+2RxGFh1egO+s6VNUz5ynz6plcEvMM4pWnGS+TCc75/sim20BxpkkjEfT/D5eFZpHe5u1nyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBw3MiiJf1wk7QekGzHSITbBh/ZXLm3Jxwd6mxESFTt4AiEAs+/ax6s1O/1YbniDHnEhETNkzR2qjav4wIWM7cB6Bns="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/if-node-version-0.0.0.tgz_1467470286973_0.3875369103625417"}},"0.1.0":{"name":"if-node-version","version":"0.1.0","description":"Run commands if on specified node version.","engines":{"node":">=0.10.0"},"main":"lib/index.js","bin":{"if-node-version":"bin/index.js"},"files":["bin","lib"],"scripts":{"clean":"rimraf .nyc_output coverage","lint":"eslint bin lib test","coverage":"wait-on coverage/lcov-report/index.html && opener coverage/lcov-report/index.html","coveralls":"cat coverage/lcov.info | coveralls","preversion":"run-s clean test","postversion":"git push && git push --tags","test":"run-s clean lint test:main","test:main":"nyc --require babel-register --reporter=lcov mocha \"test/*.js\" --timeout 10000","watch":"npm run clean && run-p watch:main coverage","watch:main":"chokidar \"{bin,lib,test}/**/*.js\" --initial --command \"npm run test:main\""},"dependencies":{"cross-spawn":"^4.0.0","semver":"^5.2.0"},"devDependencies":{"babel-preset-power-assert":"^1.0.0","babel-register":"^6.9.0","chokidar-cli":"^1.2.0","coveralls":"^2.11.9","eslint":"^2.13.1","eslint-config-mysticatea":"^4.0.0","mocha":"^2.5.3","npm-run-all":"^2.3.0","nyc":"^6.6.1","opener":"^1.4.1","pinkie-promise":"^2.0.1","power-assert":"^1.4.1","rimraf":"^2.5.2","wait-on":"^1.5.2"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"keywords":[],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"homepage":"https://github.com/mysticatea/if-node-version#readme","gitHead":"01ede1de3763c19db1ef7958e6301f2b7f048b0f","_id":"if-node-version@0.1.0","_shasum":"ac4eb92d7337ace81a001676f529d9f4eab4c40e","_from":".","_npmVersion":"3.9.0","_nodeVersion":"6.2.0","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"shasum":"ac4eb92d7337ace81a001676f529d9f4eab4c40e","tarball":"https://registry.npmjs.org/if-node-version/-/if-node-version-0.1.0.tgz","integrity":"sha512-eDkK7oEDgj16rBCn06Www0ZX4YsxthFAiZcaCf2whQLjkLKxIaNnAChCjgGBNKz8PoerQMhImw0EYwAnrtBp/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFaLvuxUu/2oo/M4oFkQasYW2M6BxC7FlL5814VF1nnoAiAKqTqsYVX50vxBM5jPiNDut4hja8Th7wHspRczi/yGgA=="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/if-node-version-0.1.0.tgz_1467547865802_0.9821713576093316"}},"1.0.0":{"name":"if-node-version","version":"1.0.0","description":"Run commands if on specified node version.","engines":{"node":">=0.10.0"},"main":"lib/index.js","bin":{"if-node-version":"bin/index.js"},"files":["bin","lib"],"scripts":{"clean":"rimraf .nyc_output coverage","lint":"node bin/index.js \">=4\" eslint bin lib test","coverage":"wait-on coverage/lcov-report/index.html && opener coverage/lcov-report/index.html","coveralls":"cat coverage/lcov.info | coveralls","preversion":"run-s clean test","postversion":"git push && git push --tags","test":"run-s clean lint test:main","test:main":"nyc --require babel-register --reporter=lcov mocha \"test/*.js\" --timeout 10000","watch":"npm run clean && run-p watch:main coverage","watch:main":"chokidar \"{bin,lib,test}/**/*.js\" --initial --command \"npm run test:main\""},"dependencies":{"cross-spawn":"^4.0.0","semver":"^5.2.0"},"devDependencies":{"babel-preset-power-assert":"^1.0.0","babel-register":"^6.9.0","chokidar-cli":"^1.2.0","coveralls":"^2.11.9","eslint":"^3.0.0","eslint-config-mysticatea":"^5.0.0","mocha":"^2.5.3","npm-run-all":"^2.3.0","nyc":"^6.6.1","opener":"^1.4.1","pinkie-promise":"^2.0.1","power-assert":"^1.4.1","rimraf":"^2.5.2","wait-on":"^1.5.2"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"keywords":[],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"homepage":"https://github.com/mysticatea/if-node-version#readme","gitHead":"a3c61a3ccef18a3c259f2126b472c06c1df60581","_id":"if-node-version@1.0.0","_shasum":"6dbb5b29c723683eeb54dda2e459a4309fefd46d","_from":".","_npmVersion":"3.9.0","_nodeVersion":"6.2.0","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"shasum":"6dbb5b29c723683eeb54dda2e459a4309fefd46d","tarball":"https://registry.npmjs.org/if-node-version/-/if-node-version-1.0.0.tgz","integrity":"sha512-mf1FNJ/ilQEyKnkuIoaJZf7P12fxhgqkhtMWRjOlTnrXX+yhzzpC7sJnjeAQjAbpkrxa5ZuISZTtZDtEdyGVYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlxO//dq41r8+kp2GIbQQdxGXz+CAz3EMTYi3ehXzSFAiBuGt0NwtRkJYi8o7XetRP6bKWKN6bZDJOvYARRBuIIMg=="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/if-node-version-1.0.0.tgz_1467603181614_0.8869582039769739"}},"1.1.0":{"name":"if-node-version","version":"1.1.0","description":"Run commands if on specified node version.","engines":{"node":">=0.10.0"},"main":"lib/index.js","bin":{"if-node-version":"bin/index.js"},"files":["bin","lib"],"scripts":{"clean":"rimraf .nyc_output coverage","lint":"node bin/index.js \">=4\" eslint bin lib test","preversion":"npm test","postversion":"git push && git push --tags","pretest":"run-s clean lint","test":"nyc mocha \"test/*.js\" --timeout 30000 --compilers js:babel-register","coverage":"nyc report -r lcov && opener coverage/lcov-report/index.html","watch":"mocha \"test/*.js\" --timeout 30000 --compilers js:babel-register --watch --growl","codecov":"nyc report -r lcovonly && codecov"},"dependencies":{"cross-spawn":"^4.0.0","semver":"^5.2.0"},"devDependencies":{"babel-preset-power-assert":"^1.0.0","babel-register":"^6.9.0","chokidar-cli":"^1.2.0","codecov":"^1.0.1","eslint":"^3.6.0","eslint-config-mysticatea":"^6.0.0","mocha":"^3.0.2","npm-run-all":"^3.1.0","nyc":"^8.3.0","opener":"^1.4.1","pinkie-promise":"^2.0.1","power-assert":"^1.4.1","rimraf":"^2.5.2"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"keywords":[],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"homepage":"https://github.com/mysticatea/if-node-version#readme","gitHead":"d0a566eb15d60de7824950c02aabd806bf35eff4","_id":"if-node-version@1.1.0","_shasum":"d752cf7592a5c172d4ea33dc3f39ba88f05038c4","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.3.0","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"shasum":"d752cf7592a5c172d4ea33dc3f39ba88f05038c4","tarball":"https://registry.npmjs.org/if-node-version/-/if-node-version-1.1.0.tgz","integrity":"sha512-hwgxfHvldWtT0UvAyqAINnRs068scwihzKpoJ0+0lGRs8jB6o4yAjFdbh0D5FiAtYnU+1TNPt1XFmMBxryXmVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxUNF2OLcnVsr3PVw+6i4a6eE7qLpeZm0fQph3sWmUsAIgN5uYpoPt7oAjrq34S6ojmzyGXYKI5vv2kC5ia38nakQ="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/if-node-version-1.1.0.tgz_1474760946686_0.04088039114139974"}},"1.1.1":{"name":"if-node-version","version":"1.1.1","description":"Run commands if on specified node version.","engines":{"node":">=0.10.0"},"main":"lib/index.js","bin":{"if-node-version":"bin/index.js"},"files":["bin","lib"],"scripts":{"clean":"rimraf .nyc_output coverage","lint":"node bin/index.js \">=4\" eslint bin lib test","preversion":"npm test","postversion":"git push && git push --tags","pretest":"run-s clean lint","test":"nyc mocha \"test/*.js\" --timeout 30000 --compilers js:babel-register","coverage":"nyc report -r lcov && opener coverage/lcov-report/index.html","watch":"mocha \"test/*.js\" --timeout 30000 --compilers js:babel-register --watch --growl","codecov":"nyc report -r lcovonly && codecov"},"dependencies":{"cross-spawn":"^5.0.1","semver":"^5.2.0"},"devDependencies":{"babel-preset-power-assert":"^1.0.0","babel-register":"^6.9.0","chokidar-cli":"^1.2.0","codecov":"^1.0.1","eslint":"^3.10.0","eslint-config-mysticatea":"^7.0.1","mocha":"^3.0.2","npm-run-all":"^3.1.0","nyc":"^8.3.0","opener":"^1.4.1","pinkie-promise":"^2.0.1","power-assert":"^1.4.1","rimraf":"^2.5.2"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"keywords":["node","version","semver","range","check","compare","conditional","less","greater","than","run","execute","command","cli"],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"homepage":"https://github.com/mysticatea/if-node-version#readme","gitHead":"1366b98ba6192fb9b9fb696fcf05b505f9da5373","_id":"if-node-version@1.1.1","_shasum":"7fbe9fb5eb8425620e3b29449dfa286b23c37726","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.9.1","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"shasum":"7fbe9fb5eb8425620e3b29449dfa286b23c37726","tarball":"https://registry.npmjs.org/if-node-version/-/if-node-version-1.1.1.tgz","integrity":"sha512-qMcJD7ftbSWlf+6w8nzZAWKOELmG3xH5Gu5XYW2+f9uaYj1t9JX5KNWxnvNMGhu8f+uIUgnqFHLlwyKTHaLWWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTKF/k9JqiBp61LsjM2ldUMcmLUdlkojSVen7lAVibOQIhAN4UmwPxGIyngKz8mCQJzPZK5b3WY6BDQqGDRY9M5RrH"}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/if-node-version-1.1.1.tgz_1479116301240_0.46281608403660357"}}},"readme":"# if-node-version\n\n[![npm version](https://img.shields.io/npm/v/if-node-version.svg)](https://www.npmjs.com/package/if-node-version)\n[![Downloads/month](https://img.shields.io/npm/dm/if-node-version.svg)](http://www.npmtrends.com/if-node-version)\n[![Build Status](https://travis-ci.org/mysticatea/if-node-version.svg?branch=master)](https://travis-ci.org/mysticatea/if-node-version)\n[![Coverage Status](https://codecov.io/gh/mysticatea/if-node-version/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/if-node-version)\n[![Dependency Status](https://david-dm.org/mysticatea/if-node-version.svg)](https://david-dm.org/mysticatea/if-node-version)\n\nRun a shell command if it's on the node of specified versions.\n\n```bash\n$ if-node-version \">=4\" eslint lib test\n```\n\n```bash\n$ if-node-version \"<6\" node ./scripts/fallback.js\n```\n\nMaybe this helps you together with [npm-scripts].\n\n## Installation\n\n`if-node-version` can be installed with [npm].\n\n```bash\n$ npm install --save-dev if-node-version\n```\n\n- `if-node-version` requires Node.js `>=0.10.0`\n\n## Usage\n\n### CLI\n\n```\nUsage:\n    $ if-node-version <VersionRange> <Command> [...args]\n\n        Run a shell command if it's on the node of specified versions.\n        Otherwise, do nothing.\n\n        Exit code is the exit code of the <Command>.\n\n    $ if-node-version <VersionRange>\n\n        Check if it's on the node of specified versions.\n\n        Exit code is 0 if it's on the node of specified versions.\n        Otherwise, exit code is 1.\n\n    $ if-node-version --help\n\n        Show this help text.\n\n    $ if-node-version --version\n\n        Show the version number of `if-node-version` command.\n\nParameters:\n    <VersionRange> .... A text which specifies the version range of Node.js\n                        This text format is defined by node-semver module:\n                        https://www.npmjs.com/package/semver#ranges\n    <Command> ......... The shell command to execute.\n    [...args] ......... Parameters of the shell command.\n\nExamples:\n    $ if-node-version \">=4\" eslint lib test\n    $ if-node-version \"<6\" node ./scripts/fallback.js\n```\n\n### Node API\n\n```js\nvar spawnIfNodeVersion = require(\"if-node-version\")\n```\n\n#### spawnIfNodeVersion(versionRange, command, args, options)\n\nSpawn a child process with specified parameters if the node version satisfies a given version range.\n\nThis function returns [child_process.ChildProcess] object.\n\n- `versionRange` `{string}` - A text which specifies the version range of Node.js. This text format is defined by node-semver module: https://www.npmjs.com/package/semver#ranges\n- `command` `{string}` - The command to run.\n- `args` `{Array.<string>}` - List of string arguments.\n- `options` `{object}` - An option object. See [the document of `child_process.spawn`]\n\n#### spawnIfNodeVersion.sync(versionRange, command, args, options)\n\nThis is synchronous version of `spawnIfNodeVersion(versionRange, command, args, options)`.\n\nThis function returns the object as same as [child_process.spawnSync].\n\n**Note:** If you use this function on node `0.10`, you will also need to install [spawn-sync].\n\n## Changelogs\n\n- [GitHub Releases]\n\n## Contributing\n\nWelcome your contributions!<br>\nPlease use GitHub's issues/PRs.\n\n### Tools to develop\n\n- `npm install` installs dependencies.\n- `npm test` runs tests and measures coverage.\n- `npm run coverage` opens the coverage result of `npm test`.\n- `npm run clean` removes the coverage result of `npm test`.\n- `npm run lint` analyzes codes by ESLint.\n- `npm run watch` runs tests (without coverage measurement) when source code is modified.\n\n\n[npm]: https://www.npmjs.com/\n[npm-scripts]: https://docs.npmjs.com/misc/scripts\n[child_process.ChildProcess]: https://nodejs.org/api/child_process.html#child_process_class_childprocess\n[the document of `child_process.spawn`]: https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options\n[child_process.spawnSync]: https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options\n[spawn-sync]: https://www.npmjs.com/package/spawn-sync\n[GitHub Releases]: https://github.com/mysticatea/if-node-version/releases\n","maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"time":{"modified":"2022-06-19T00:15:22.476Z","created":"2016-07-02T14:38:10.558Z","0.0.0":"2016-07-02T14:38:10.558Z","0.1.0":"2016-07-03T12:11:09.369Z","1.0.0":"2016-07-04T03:33:02.180Z","1.1.0":"2016-09-24T23:49:09.000Z","1.1.1":"2016-11-14T09:38:21.456Z"},"homepage":"https://github.com/mysticatea/if-node-version#readme","keywords":["node","version","semver","range","check","compare","conditional","less","greater","than","run","execute","command","cli"],"repository":{"type":"git","url":"git+https://github.com/mysticatea/if-node-version.git"},"author":{"name":"Toru Nagashima"},"bugs":{"url":"https://github.com/mysticatea/if-node-version/issues"},"license":"MIT","readmeFilename":"README.md"}