1 | const chalk = require('chalk')
|
2 | const upToDate = require('./up-to-date')
|
3 |
|
4 | const oldNode = 'You are using an older version of node'
|
5 | const getNode = ' Upgrade to the latest supported version of node'
|
6 |
|
7 | module.exports = async ({ pkg }) => {
|
8 | const warnings = []
|
9 | const details = []
|
10 | if (upToDate(process.version.slice(1), pkg.adFormatsMinimumSupported.nodeVersion)) {
|
11 | details.push(chalk`You are using node version ${process.version} {green (up to date)}`)
|
12 | } else {
|
13 | details.push(chalk`You are using node version ${process.version} {red (not up to date)}`)
|
14 | warnings.push(`${oldNode}\n${getNode}`)
|
15 | }
|
16 | return { warnings, details }
|
17 | }
|