UNPKG

azury

Version:

Powerful Javascript SDK for Azury

15 lines (10 loc) 595 B
import fetch from 'node-fetch' import { update, warn } from './logger.js' import { version as currentVersion } from '../config.js' export default async function notifier() { const res = await fetch('https://cdn.jsdelivr.net/npm/azury@latest/package.json', { method: 'GET' }) if (res.status !== 200) return await warn('Couldn\'t check for any available updates!') const json = await res.json() const { version } = json if (version !== currentVersion) return await update(`Please consider upgrading the Azury SDK to v${version} for the latest features and patches.`) }