valzyysdk
Version:
CLI dan modul untuk mengakses data dari API JKT48Connect, termasuk data member, teater, event, pembayaran, dan lainnya.
56 lines (49 loc) • 2.54 kB
JavaScript
// scripts/postinstall-notice.js
const packageJson = require('../package.json');
console.log(`
╔══════════════════════════════════════════════════════════════╗
║ 🎉 INSTALLATION SUCCESSFUL 🎉 ║
╠══════════════════════════════════════════════════════════════╣
║ Package: ${packageJson.name.padEnd(48)} ║
║ Version: ${packageJson.version.padEnd(48)} ║
╠══════════════════════════════════════════════════════════════╣
║ Thank you for installing JKT48 Connect SDK! ║
║ ║
║ 📚 Documentation: https://docs.jkt48connect.my.id ║
║ 🔧 Support: https://github.com/jkt48connect-corp/sdk ║
║ ║
║ 💡 For more features, check out @jkt48/core ║
║ ║
║ This package includes automatic version checking to ║
║ ensure you're always using the latest features and ║
║ security updates. ║
╚══════════════════════════════════════════════════════════════╝
`);
// Optional: Check for updates periodically
const https = require('https');
function checkForUpdates() {
const url = `https://registry.npmjs.org/${packageJson.name}/latest`;
https.get(url, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
try {
const latestInfo = JSON.parse(data);
if (latestInfo.version !== packageJson.version) {
console.log(`
ℹ️ Update available: ${packageJson.version} → ${latestInfo.version}
Run: npm install ${packageJson.name}@latest
`);
}
} catch (error) {
// Silent fail
}
});
}).on('error', () => {
// Silent fail
});
}
// Check for updates (non-blocking)
setTimeout(checkForUpdates, 1000);