azury
Version:
Powerful Javascript SDK for Azury
24 lines (16 loc) • 820 B
JavaScript
import { error, success } from './core/logger.js'
import notifier from './core/notifier.js'
let notifyOnUpdate
let secret
export default async function azury(config) {
if (!config) return await error('Please configure Azury properly.')
secret = config.secret
if (!secret || typeof secret !== 'string' || secret.length !== 128) return await error('Please provide a valid secret.')
notifyOnUpdate = config.notifyOnUpdate || true
if (typeof notifyOnUpdate !== 'boolean') return await error('Please ensure the "notifyOnUpdate" parameter is a boolean.')
// notify when there's a new version out
if (notifyOnUpdate === true) await notifier()
// console log message on successful launch
await success('Successfully launched the Azury SDK.')
}
export { notifyOnUpdate, secret }