{"name":"please-upgrade-node","version":"3.0.2","description":"Displays a beginner-friendly message telling your user to upgrade their version of Node","main":"index.js","scripts":{"test":"node test","prepublishOnly":"pkg-ok","fix":"prettier --write *.js"},"repository":{"type":"git","url":"git+https://github.com/typicode/please-upgrade-node.git"},"keywords":["node","engines","version","check","verify","upgrade"],"author":{"name":"typicode"},"license":"MIT","bugs":{"url":"https://github.com/typicode/please-upgrade-node/issues"},"homepage":"https://github.com/typicode/please-upgrade-node#readme","devDependencies":{"mock-require":"^2.0.2","pkg-ok":"^1.1.0","prettier":"^1.5.2"},"dependencies":{"semver-compare":"^1.0.0"},"gitHead":"d6109c499055e0372cdf62fbdc42781958182a42","_id":"please-upgrade-node@3.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"typicode","email":"typicode@gmail.com"},"dist":{"integrity":"sha512-bslfSeW+ksUbB/sYZeEdKFyTG4YWU9YKRvqfSRvZKE675khAuBUPqV5RUwJZaGuWmVQLweK45Q+lPHFVnSlSug==","shasum":"7b9eaeca35aa4a43d6ebdfd10616c042f9a83acc","tarball":"http://registry-npm.ywwl.com/please-upgrade-node/download/please-upgrade-node-3.0.2.tgz","fileCount":4,"unpackedSize":4071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4QAvCRA9TVsSAnZWagAARr4QAJ+YX0tSyyZaOs1qRQp9\nNaKlqYE5ny8NnNRxZcgDsR7R/jWN7F9Et1WyDsgyR89ZPKeRAnRHrW08zsqF\nm8d/usqPDi65+DUhVCwHkYguCO49lW2lMR19DhSdhFM1kSn+131Xyc5NC0bk\ng0WSW9QHCKzwAM9LeU3MnMt4WfsgR8S/toaFVVuRyeSkpIuKW+DkUolNH2Sn\n24Px0L3dd18NbWIzv8kWkU2RfO1ywKcs9PmkTSTxYUFlQHZvgQHQVatKOq9p\nonnVuNYvuRfJQ3bDnQ+87adfM6KmErOBGM2sq2wSR91ngUxQ9NktjuY5439C\nF8nZ4H06umKEG6YQpzEzY/OpjITWmwfbIgMuPJ1lLdn3Ao3lWKhdaYvT3i0i\nxgjh+k9eNZEBiL+sNf0njyONWjregdMhoXGgc40dcVSj6HUIRJgHffc+ZT3U\n3kjTcUTrFRIRuRUxj56GRWMH9ShBE1NVsLy+ST6X45ip7hWSdGo84gxXyKg4\nnV2UhyTAb2BIurXLeW3gJTRngWngHK6pZ+BTk60V5/2lnzf51TqoWrUilb/2\n8tCYSoH6lX1FxENfioDTC1MM6tDX9qesvFR5ro8gpt7EWHi82cT+J3f7Aqs1\n/djISdptczFSHrRIQ12+GSzOK5Wl8Ii0SdYSsT/K3XY+7BF3+T4yqf5L9vnH\nZ/9A\r\n=tTRh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGuHsuS2zX8+lkFePAs2PawygOd8PNhpIcsHqWv8G8hAiEA5qHW5K93C4DIBt7I7KoF1YZzCA4TSd5PNo7Bfg2Jb5I="}],"size":2112,"noattachment":false,"key":"/please-upgrade-node/-/please-upgrade-node-3.0.2.tgz"},"maintainers":[{"name":"typicode","email":"typicode@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/please-upgrade-node_3.0.2_1524695086221_0.8313554362912727"},"_hasShrinkwrap":false,"readme":"# Please upgrade Node [![](http://img.shields.io/npm/dm/please-upgrade-node.svg?style=flat)](https://www.npmjs.org/package/please-upgrade-node) [![Build Status](https://travis-ci.org/typicode/please-upgrade-node.svg?branch=master)](https://travis-ci.org/typicode/please-upgrade-node) [![npm](https://img.shields.io/npm/v/please-upgrade-node.svg)](https://www.npmjs.com/package/please-upgrade-node)\n\n> :information_desk_person: show a message to your users to upgrade Node instead of a stacktrace \n\nIt's common for new Node users to miss or not understand engines warning when installing a CLI. This package displays a beginner-friendly message if their Node version is below the one expected.\n\n```sh\n$ node -v\n0.12\n\n$ modern-cli\nmodern-cli requires at least version 6 of Node, please upgrade\n```\n\n## Support\n\nIf you like this project, you can support me on [GitHub Sponsors](https://github.com/users/typicode/sponsorship)\n\n## Usage\n\n```sh\nnpm install please-upgrade-node\n```\n\nAdd `please-upgrade-node` at the top of your CLI\n\n```js\n#!/usr/bin/env node\nconst pkg = require('./package.json')\nrequire('please-upgrade-node')(pkg) // <- Must run BEFORE requiring any other modules\n\n// ...\n```\n\nSet in your `package.json` the required Node version\n\n```js\n{\n  \"engines\": {\n    \"node\": \">=6\"\n  }\n}\n```\n\n__Important__: `>=` is the only operator supported by `please-upgrade-node` (e.g. `>=6`, `>=6.0`, `>=6.0.0`).\n\n## Options\n\nYou can set custom `exitCode` and `message` function if needed\n\n```js\npleaseUpgradeNode(pkg, {\n  exitCode: 0, // Default: 1\n  message: function(requiredVersion) {\n    return 'Oops this program require Node ' +  requiredVersion\n  }\n})\n```\n\n__Important__: to keep `message` function compatible with older versions of Node, avoid using ES6 features like `=>` or string interpolation.\n\n## See also\n\n* [pkg-ok](https://github.com/typicode/pkg-ok) - :ok_hand: Prevents publishing a module with bad paths\n* [husky](https://github.com/typicode/husky) - :dog: Git hooks made easy\n* [update-notifier](https://github.com/yeoman/update-notifier) - Update notifications for your CLI app \n\nThanks to [zeit/serve](https://github.com/zeit/serve) for the error message inspiration.\n\n## License\n\nMIT - [Typicode :cactus:](https://github.com/typicode) - [Patreon](https://patreon.com/typicode)\n","publish_time":1524695086352,"_cnpm_publish_time":1524695086352,"dist-tags":{"latest":"3.2.0"}}