Introduction
Most event systems tie you to a framework’s own bus, or force every listener to match a raw (event, data) pair by hand. beepr separates two things:
- the event vocabulary:
request,success,error,data,complete,connected,disconnected; - the adapter: a typed object (
onRequest,onSuccess,onError…) thatcreateNotifyturns into a raw handler.
On top of that, beepr adds two safety nets:
- redaction: payloads are masked before adapters see them;
- debug gating: debug output only runs in environments you allow.
Install
Section titled “Install”beepr is not published to npm yet. Install it from GitHub:
pnpm add github:techmefr/beeprA minimal example
Section titled “A minimal example”import { createNotify } from 'beepr'
const notify = createNotify({ onRequest: context => console.log('request', context.resource), onSuccess: data => console.log('success', data), onError: error => console.error('error', error.message),})
notify('request', { resource: 'users', payload: { id: 1 } })notify('success', { id: 1, name: 'Alice' })- Redaction: what gets masked.
- Debug channel: environment-gated diagnostics.
- Pairing with nexdk: use beepr as nexdk’s
notify. - beepr API: every runtime export.