jexkcode 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/engine-requirements.js +13 -7
- package/package.json +11 -2
package/engine-requirements.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
const major =
|
|
2
|
-
process.versions.node.split('.')[0],
|
|
3
|
-
10
|
|
4
|
-
);
|
|
1
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
// require(esm) — needed so CommonJS (require()) consumers can load this
|
|
4
|
+
// ESM package — is only unflagged on Node >=20.19.0 (20.x line) or
|
|
5
|
+
// >=22.12.0 (22.x+ line).
|
|
6
|
+
const supported =
|
|
7
|
+
major >= 23 ||
|
|
8
|
+
(major === 22 && minor >= 12) ||
|
|
9
|
+
(major === 20 && minor >= 19);
|
|
10
|
+
|
|
11
|
+
if (!supported) {
|
|
7
12
|
console.error(
|
|
8
|
-
`\n❌ This package requires Node.js 20
|
|
13
|
+
`\n❌ This package requires Node.js >=20.19.0 (on the 20.x line) or ` +
|
|
14
|
+
`>=22.12.0 (on the 22.x+ line) so both "import" and "require()" work.\n` +
|
|
9
15
|
` You are using Node.js ${process.versions.node}.\n` +
|
|
10
|
-
` Please upgrade
|
|
16
|
+
` Please upgrade Node.js to proceed.\n`
|
|
11
17
|
);
|
|
12
18
|
process.exit(1);
|
|
13
19
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jexkcode",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "JexkCode Baileys - Enhanced WhatsApp Web API with interactive messages, albums, newsletter support, and AIRich responses.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"module-sync": "./lib/index.js",
|
|
12
|
+
"import": "./lib/index.js",
|
|
13
|
+
"default": "./lib/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
8
17
|
"scripts": {
|
|
9
18
|
"preinstall": "node ./engine-requirements.js"
|
|
10
19
|
},
|
|
11
20
|
"engines": {
|
|
12
|
-
"node": ">=20.
|
|
21
|
+
"node": ">=20.19.0"
|
|
13
22
|
},
|
|
14
23
|
"repository": {
|
|
15
24
|
"type": "git",
|