{"id":13465004,"url":"https://github.com/typicode/please-upgrade-node","last_synced_at":"2025-04-08T02:42:07.059Z","repository":{"id":22533532,"uuid":"96620623","full_name":"typicode/please-upgrade-node","owner":"typicode","description":":information_desk_person: Show a message to your users to upgrade Node instead of a stacktrace ","archived":false,"fork":false,"pushed_at":"2023-05-15T04:00:36.000Z","size":127,"stargazers_count":241,"open_issues_count":10,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T01:41:57.852Z","etag":null,"topics":["cli","engines","node","package","upgrade","version"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typicode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"typicode"}},"created_at":"2017-07-08T13:26:56.000Z","updated_at":"2025-01-08T04:34:39.000Z","dependencies_parsed_at":"2024-07-31T14:07:43.924Z","dependency_job_id":null,"html_url":"https://github.com/typicode/please-upgrade-node","commit_stats":{"total_commits":54,"total_committers":3,"mean_commits":18.0,"dds":0.09259259259259256,"last_synced_commit":"96caece1c2bedb0b5dbbc037f59c0ce2102d7405"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fplease-upgrade-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fplease-upgrade-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fplease-upgrade-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fplease-upgrade-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typicode","download_url":"https://codeload.github.com/typicode/please-upgrade-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767232,"owners_count":20992538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","engines","node","package","upgrade","version"],"created_at":"2024-07-31T14:00:54.796Z","updated_at":"2025-04-08T02:42:07.040Z","avatar_url":"https://github.com/typicode.png","language":"JavaScript","funding_links":["https://github.com/sponsors/typicode"],"categories":["JavaScript","Uncategorized","cli","node"],"sub_categories":["Uncategorized"],"readme":"# Please upgrade Node [![](http://img.shields.io/npm/dm/please-upgrade-node.svg?style=flat)](https://www.npmjs.org/package/please-upgrade-node) [![npm](https://img.shields.io/npm/v/please-upgrade-node.svg)](https://www.npmjs.com/package/please-upgrade-node)\n\n\u003e :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\n12\n\n$ modern-cli\nmodern-cli requires at least version 16 of Node, please upgrade\n```\n\n## Status\n\n**This project is considered feature complete and stable**. Only maintenance updates will be published. That said since the goal of the project is to check previous versions of Node, code is unlikely to be modified as it needs to work on very old versions.\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) // \u003c- 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\": \"\u003e=6\"\n  }\n}\n```\n\n__Important__: `\u003e=` is the only operator supported by `please-upgrade-node` (e.g. `\u003e=6`, `\u003e=6.0`, `\u003e=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 `=\u003e` or string interpolation.\n\n## See also\n\n* [xv](https://github.com/typicode/xv) - ✅ Simple test runner\n* [husky](https://github.com/typicode/husky) - 🐕 Git hooks made easy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fplease-upgrade-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypicode%2Fplease-upgrade-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fplease-upgrade-node/lists"}