All Projects → typicode → Please Upgrade Node

typicode / Please Upgrade Node

Licence: mit
💁 Show a message to your users to upgrade Node instead of a stacktrace

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Please Upgrade Node

Npmvet
A simple CLI tool for vetting npm package versions
Stars: ✭ 193 (-11.87%)
Mutual labels:  version, cli, package
Apio
🌱 Open source ecosystem for open FPGA boards
Stars: ✭ 366 (+67.12%)
Mutual labels:  cli, package
Repology Updater
Repology backend service to update repository and package data
Stars: ✭ 348 (+58.9%)
Mutual labels:  version, package
Gub
CLI tool for create an npm package from any repos. 🐳
Stars: ✭ 31 (-85.84%)
Mutual labels:  cli, package
Construct
A PHP project/micro-package generator for PDS compliant projects or micro-packages.
Stars: ✭ 257 (+17.35%)
Mutual labels:  cli, package
Cli
🆑📍 Setup automated semver compliant package publishing
Stars: ✭ 272 (+24.2%)
Mutual labels:  version, package
Typac
install npm packages along with corresponding typings
Stars: ✭ 29 (-86.76%)
Mutual labels:  cli, package
Pkg Ok
👌 Checks paths and scripts defined in package.json before you publish
Stars: ✭ 219 (+0%)
Mutual labels:  cli, package
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (-64.38%)
Mutual labels:  cli, package
Npm Try
🚆 Quickly try npm packages without writing boilerplate code.
Stars: ✭ 103 (-52.97%)
Mutual labels:  cli, package
Headlesschrome
A Go package for working with headless Chrome. Run interactive JavaScript commands on web pages with Go and Chrome.
Stars: ✭ 112 (-48.86%)
Mutual labels:  cli, package
version-check
An action that allows you to check whether your npm package version has been updated
Stars: ✭ 65 (-70.32%)
Mutual labels:  package, version
repology-rules
Package normalization ruleset for Repology
Stars: ✭ 67 (-69.41%)
Mutual labels:  package, version
Wasm Pack
This tool seeks to be a one-stop shop for building and working with rust- generated WebAssembly that you would like to interop with JavaScript, in the browser or with Node.js. wasm-pack helps you build rust-generated WebAssembly packages that you could publish to the npm registry, or otherwise use alongside any javascript packages in workflows that you already use, such as webpack.
Stars: ✭ 3,848 (+1657.08%)
Mutual labels:  cli, package
app-version-laravel
Laravel application versioning
Stars: ✭ 24 (-89.04%)
Mutual labels:  package, version
Standard Version
🏆 Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
Stars: ✭ 5,806 (+2551.14%)
Mutual labels:  version, cli
Gosearch
🔍 Search the Go packages via command-line
Stars: ✭ 48 (-78.08%)
Mutual labels:  cli, package
Pip Check
pip-check gives you a quick overview of all installed packages and their update status.
Stars: ✭ 134 (-38.81%)
Mutual labels:  version, package
Semantic Release
📦🚀 Fully automated version management and package publishing
Stars: ✭ 14,364 (+6458.9%)
Mutual labels:  version, package
Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (-2.74%)
Mutual labels:  cli

Please upgrade Node Build Status npm

💁 show a message to your users to upgrade Node instead of a stacktrace

It'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.

$ node -v
0.12

$ modern-cli
modern-cli requires at least version 6 of Node, please upgrade

Support

If you like this project, you can support me on GitHub Sponsors

Usage

npm install please-upgrade-node

Add please-upgrade-node at the top of your CLI

#!/usr/bin/env node
const pkg = require('./package.json')
require('please-upgrade-node')(pkg) // <- Must run BEFORE requiring any other modules

// ...

Set in your package.json the required Node version

{
  "engines": {
    "node": ">=6"
  }
}

Important: >= is the only operator supported by please-upgrade-node (e.g. >=6, >=6.0, >=6.0.0).

Options

You can set custom exitCode and message function if needed

pleaseUpgradeNode(pkg, {
  exitCode: 0, // Default: 1
  message: function(requiredVersion) {
    return 'Oops this program require Node ' +  requiredVersion
  }
})

Important: to keep message function compatible with older versions of Node, avoid using ES6 features like => or string interpolation.

See also

  • pkg-ok - 👌 Prevents publishing a module with bad paths
  • husky - 🐶 Git hooks made easy
  • update-notifier - Update notifications for your CLI app

Thanks to zeit/serve for the error message inspiration.

License

MIT - Typicode 🌵 - Patreon

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].