FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
adminforth/adminforth/commands/nodeVersion.js at next · devforth/adminforth · GitHub
devforth
adminforth
Repository navigation
Code
Issues
16
(16)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
adminforth
/
adminforth
/
commands
/
nodeVersion.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (13 loc) · 568 Bytes
Breadcrumbs
adminforth
/
adminforth
/
commands
/
nodeVersion.js
Copy path
File metadata and controls
15 lines (13 loc) · 568 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export
const
SUPPORTED_NODE_VERSIONS
=
'22.12+, 24, or 26'
;
export
function
isNodeVersionSupported
(
version
=
process
.
versions
.
node
)
{
const
[
major
,
minor
]
=
version
.
split
(
'.'
)
.
map
(
Number
)
;
return
(
major
===
22
&&
minor
>=
12
)
||
major
===
24
||
major
===
26
;
}
export
function
checkNodeVersion
(
version
=
process
.
versions
.
node
)
{
if
(
!
isNodeVersionSupported
(
version
)
)
{
throw
new
Error
(
`AdminForth does not support Node.js
${
version
}
. `
+
`Please use Node.js
${
SUPPORTED_NODE_VERSIONS
}
. Node.js 20 and 21 are no longer supported.`
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL