UNPKG

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
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;