1.0.3 • Published 3 years ago
shoutrrrd-js v1.0.3
shoutrrrd-js
A javascript/typescript library for sending messages with shoutrrrd.
Install
npm install shoutrrrd-js
How to use
Set up a shoutrrrd server and configure it.
import { Shoutrrr } from 'shoutrrrd-js'
const shoutrrr = new Shoutrrr('http://localhost:8000')
shoutrrr.send('discord', 'This is a notification message that will be displayed on discord.')
.then(() => console.log('Message sent'))
.catch((error) => console.log(`Error ${error} happend while sending message.`))
// or with async
async function main () {
await shoutrrr.send('service', 'message')
}
main()
Error handling
Following errors can be happen while sending a message:
import {
ServiceDoesNotExists, // when the service on the service doesn't exist this exception will be thrown.
InternalServerError
} from 'shoutrrr-js'