Skip to content

Commit 35881a3

Browse files
committed
feat(node)!: upgrade to v20
Node 18 is EOL
1 parent 94ec6ac commit 35881a3

File tree

4 files changed

+4546
-4502
lines changed

4 files changed

+4546
-4502
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest]
19-
node: [18]
19+
node: [20]
2020

2121
steps:
2222
- uses: actions/setup-node@v3

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"type": "module",
66
"engines": {
7-
"node": ">=18.0.0"
7+
"node": ">=20.0.0"
88
},
99
"homepage": "https://nuxt-security.vercel.app",
1010
"description": "🛡️ Security Module for Nuxt based on HTTP Headers and Middleware",
@@ -68,7 +68,7 @@
6868
"@nuxt/module-builder": "^0.8.3",
6969
"@nuxt/schema": "^3.11.2",
7070
"@nuxt/test-utils": "^3.12.0",
71-
"@types/node": "^18.18.1",
71+
"@types/node": "^20.14.8",
7272
"changelogen": "^0.5.7",
7373
"eslint": "^8.50.0",
7474
"nuxt": "^3.11.2",

src/utils/crypto.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
// These two lines are required only to maintain compatibility with Node 18
2-
// - In Node 19 and above, crypto is available in the global scope
3-
// - In Workers environments, crypto is available in the global scope
4-
import { webcrypto } from 'node:crypto'
5-
globalThis.crypto ??= webcrypto as Crypto
6-
71
export async function generateHash(content: Buffer | string, hashAlgorithm: 'SHA-256' | 'SHA-384' | 'SHA-512') {
82
let buffer: Uint8Array
93
if (typeof content === 'string') {

0 commit comments

Comments
 (0)