autoft-qris
Version:
Package untuk generate QRIS dengan 2 tema (Biru & Hijau) dan cek payment status secara realtime dengan API OrderKuota
81 lines (73 loc) ⢠3.73 kB
JavaScript
const path = require('path');
class DeprecationWarning {
static checkNodeVersion() {
const nodeVersion = process.version;
const currentVersion = nodeVersion.slice(1);
const targetVersion = '21.7.3';
if (currentVersion !== targetVersion) {
console.log('\n' + '='.repeat(60));
console.log('ā ļø NODE.JS VERSION WARNING!');
console.log('='.repeat(60));
console.log(`š“ Node.js ${nodeVersion} detected`);
console.log('ā Chalk package hanya support Node.js 21.7.3');
console.log('š Solusi:');
console.log(' ⢠Install Node.js 21.7.3 secara spesifik');
console.log(' ⢠Versi lain akan menyebabkan chalk error');
console.log(`š” Required Node.js version: ${targetVersion}`);
console.log('='.repeat(60) + '\n');
return false;
}
return true;
}
static showUpdateNotification() {
try {
const chalk = require('chalk');
const packageJsonPath = path.resolve(__dirname, '../package.json');
const currentVersion = require(packageJsonPath).version;
console.log('\n' + '='.repeat(60));
console.log(chalk.yellow.bold('š UPDATE TERSEDIA!'));
console.log('='.repeat(60));
console.log(chalk.cyan('š¦ Package: autoft-qris'));
console.log(chalk.green(`⨠Versi Terbaru: v${currentVersion}`));
console.log(chalk.blue('šØ Fitur Baru:'));
console.log(chalk.white(' ⢠2 Tema QRIS (Default & Meta Style)'));
console.log(chalk.white(' ⢠ESM & CommonJS Support'));
console.log(chalk.white(' ⢠Perbaikan performa'));
console.log(chalk.white(' ⢠API yang lebih bersih'));
console.log(chalk.yellow('\nš” Untuk update:'));
console.log(chalk.white(' npm update autoft-qris'));
console.log(chalk.gray('\nš Dokumentasi lengkap:'));
console.log(chalk.blue(' https://github.com/AutoFTbot/Qris-OrderKuota'));
console.log(chalk.magenta('\nšØāš» Original Author: AutoFTbot'));
console.log(chalk.green('š¤ Contributor: AlfiDev'));
console.log('='.repeat(60) + '\n');
} catch (error) {
console.log('\n' + '='.repeat(60));
console.log('š UPDATE TERSEDIA!');
console.log('='.repeat(60));
console.log('š¦ Package: autoft-qris');
console.log('⨠Versi Terbaru dengan fitur baru!');
console.log('šØ Fitur Baru:');
console.log(' ⢠2 Tema QRIS (Default & Meta Style)');
console.log(' ⢠ESM & CommonJS Support');
console.log(' ⢠Perbaikan performa');
console.log(' ⢠API yang lebih bersih');
console.log('\nš” Untuk update:');
console.log(' npm update autoft-qris');
console.log('\nš Dokumentasi lengkap:');
console.log(' https://github.com/AutoFTbot/Qris-OrderKuota');
console.log('\nšØāš» Original Author: AutoFTbot');
console.log('š¤ Contributor: AlfiDev');
console.log('='.repeat(60) + '\n');
}
}
static checkAndShowWarning() {
try {
if (process.env.NODE_ENV === 'production') return;
if (!this.checkNodeVersion()) return;
this.showUpdateNotification();
} catch (error) {
}
}
}
module.exports = DeprecationWarning;