[api-minor] Update the minimum supported Node.js version to 16

This patch updates the minimum supported environments as follows:
 - Node.js 16, which was released on 2021-04-20; see https://en.wikipedia.org/wiki/Node.js#Releases

Note also that Node.js 14 will very soon reach EOL, and thus no longer receive any security updates.
This commit is contained in:
Jonas Jenwald 2023-03-07 12:03:45 +01:00
parent 076fdbf6df
commit 6d3506548d
4 changed files with 10 additions and 23 deletions

View File

@ -82,7 +82,7 @@ const ENV_TARGETS = [
"Chrome >= 87", "Chrome >= 87",
"Firefox ESR", "Firefox ESR",
"Safari >= 14.1", "Safari >= 14.1",
"Node >= 14", "Node >= 16",
"> 1%", "> 1%",
"not IE > 0", "not IE > 0",
"not dead", "not dead",
@ -2220,6 +2220,9 @@ function packageJson() {
type: "git", type: "git",
url: DIST_REPO_URL, url: DIST_REPO_URL,
}, },
engines: {
node: ">=16",
},
}; };
return createStringSource( return createStringSource(

3
package-lock.json generated
View File

@ -69,6 +69,9 @@
"webpack-stream": "^7.0.0", "webpack-stream": "^7.0.0",
"wintersmith": "^2.5.0", "wintersmith": "^2.5.0",
"yargs": "^17.6.2" "yargs": "^17.6.2"
},
"engines": {
"node": ">=16"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {

View File

@ -70,5 +70,8 @@
"type": "git", "type": "git",
"url": "git://github.com/mozilla/pdf.js.git" "url": "git://github.com/mozilla/pdf.js.git"
}, },
"engines": {
"node": ">=16"
},
"license": "Apache-2.0" "license": "Apache-2.0"
} }

View File

@ -16,28 +16,6 @@
import { isNodeJS } from "./is_node.js"; import { isNodeJS } from "./is_node.js";
// Support: Node.js<16.0.0
(function checkNodeBtoa() {
if (globalThis.btoa || !isNodeJS) {
return;
}
globalThis.btoa = function (chars) {
// eslint-disable-next-line no-undef
return Buffer.from(chars, "binary").toString("base64");
};
})();
// Support: Node.js<16.0.0
(function checkNodeAtob() {
if (globalThis.atob || !isNodeJS) {
return;
}
globalThis.atob = function (input) {
// eslint-disable-next-line no-undef
return Buffer.from(input, "base64").toString("binary");
};
})();
// Support: Node.js // Support: Node.js
(function checkDOMMatrix() { (function checkDOMMatrix() {
if (globalThis.DOMMatrix || !isNodeJS) { if (globalThis.DOMMatrix || !isNodeJS) {