UNPKG

645 BJavaScriptView Raw
1const chalk = require('chalk')
2const upToDate = require('./up-to-date')
3
4const oldNode = 'You are using an older version of node'
5const getNode = ' Upgrade to the latest supported version of node'
6
7module.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}