npm.io
1.0.3 • Published 6 years ago

utililogs-client

Licence
Unlicense
Version
1.0.3
Deps
1
Size
2 kB
Vulns
0
Weekly
0

UtiliLogs Client

A client library for interfacing with UtiliLogs - an external and real-time logging system

Usage

const createUtiliLogsClient = require("utililogs-client")

// host starts with `ws://` or `wss://` (ie.: ws://localhost:4000)
// token is given by UtiliLogs and is a string
const client = createUtiliLogsClient(host, token)

// emoji and id are optional
// message is required
// one of `timestamp_s` or `timestamp_ms` is required
client.log({
    emoji: "🎉",
    id: "123456789",
    message: "We logged in!",
    timestamp_ms: Date.now(),
})

// optional, but can be used for cleaner shutdowns
client.close()