From 396297c8970ba2b8636e50d118335ca97de7bfe3 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Thu, 6 Mar 2025 04:24:04 +0200 Subject: [PATCH] package!: set new Node version minimum breaking change --- engine-requirements.js | 10 ++++++++++ package.json | 18 ++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 engine-requirements.js diff --git a/engine-requirements.js b/engine-requirements.js new file mode 100644 index 0000000..136dcfd --- /dev/null +++ b/engine-requirements.js @@ -0,0 +1,10 @@ +const major = parseInt(process.versions.node.split('.')[0], 10); + +if (major < 20) { + console.error( + `\n❌ This package requires Node.js 20+ to run reliably.\n` + + ` You are using Node.js ${process.versions.node}.\n` + + ` Please upgrade to Node.js 20+ to proceed.\n` + ); + process.exit(1); +} diff --git a/package.json b/package.json index 534a88e..2aea558 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,17 @@ { "name": "baileys", "version": "6.7.16", - "description": "WhatsApp API", + "description": "A WebSockets library for interacting with WhatsApp Web", "keywords": [ "whatsapp", - "js-whatsapp", - "whatsapp-api", - "whatsapp-web", - "whatsapp-chat", - "whatsapp-group", - "automation", - "multi-device" + "automation" ], "homepage": "https://github.com/WhiskeySockets/Baileys", "repository": { "url": "git@github.com:WhiskeySockets/Baileys.git" }, "license": "MIT", - "author": "Adhiraj Singh", + "author": "Rajeh Taher", "main": "lib/index.js", "types": "lib/index.d.ts", "files": [ @@ -38,6 +32,7 @@ "lint:fix": "yarn lint --fix", "prepack": "tsc", "prepare": "tsc", + "preinstall": "node ./engine-requirements.js", "release": "release-it", "test": "jest" }, @@ -100,5 +95,8 @@ "optional": true } }, - "packageManager": "yarn@1.22.19" + "packageManager": "yarn@1.22.19", + "engines": { + "node": ">=20.0.0" + } }