UNPKG

chatbotlouis

Version:

chat

24 lines 1.76 kB
const chalk = require('chalk') module.exports = async () => { try { require.resolve("node-fetch") } catch (e) { return; } const packageData = await require('node-fetch')(`https://registry.npmjs.com/newgen`).then(text => text.json()) if (require('../package.json').version !== packageData['dist-tags'].latest) { console.log('\n\n') console.log(chalk.white.bold('\x1b[32m' + '---------------------------------------------------')) console.log(chalk.white.bold('\x1b[32m' + '| @ newgen - [] X |')) console.log(chalk.white.bold('\x1b[32m' + '---------------------------------------------------')) console.log(chalk.white.bold('\x1b[33m' + `| The module is\x1b[31m out of date!\x1b[33m |`)) console.log(chalk.white.bold('\x1b[35m' + '| New version is available! |')) console.log(chalk.white.bold('\x1b[34m' + `| ${require('../package.json').version} --> ${packageData['dist-tags'].latest} |`)) console.log(chalk.white.bold('\x1b[36m' + `| Run ${chalk.grey.bold(`"npm i newgen@${packageData['dist-tags'].latest}"`)} |`)) console.log(chalk.white.bold('\x1b[36m' + '| to update! |')) console.log(chalk.white.bold('\x1b[37m' + `| View the full changelog here: |`)) console.log(chalk.white.bold('\x1b[31m' + `| ${chalk.grey.bold(`https://www.npmjs.com/package/chatbotlouis`)} |`)) console.log(chalk.white.bold('\x1b[32m' + '---------------------------------------------------\x1b[37m')) console.log('\n\n') } };