0.1.6-beta • Published 5 months ago
lily-dmdata v0.1.6-beta
Lily-DMData
LilyDMData is an easy way for english-speaking developers (or anyone, really!) to interface with the DMData API. This library currently only supports earthquake-based connections.
This is EXTREMELY early development! It is NOT ready for reliable use!s
Install with npm i lily-dmdata
Examples
import { DMDataWebSocket, WebSocketEvent, Classification, EarthquakeInformationSchema } from 'lily-dmdata';
// Create a new socket
const SOCKET = new DMDataWebSocket('<your API key here>', 'application-name');
// Register some event listeners
SOCKET.on(WebSocketEvent.START, () => {
console.log(`Websocket opened! The socket ID is ${SOCKET.socket_id}`);
});
SOCKET.on(WebSocketEvent.EARTHQUAKE_REPORT, (data: EarthquakeInformationSchema) => {
console.log(`A new earthquake has been reported! It's maximum intensity was ${data.intensity.maxInt}.`);
});
// Open the socket and start listening.
// lily-dmdata will handle ping-pong requests automatically.
SOCKET.OpenSocket({
classifications: [
Classification.EEW_FORECAST,
Classification.EEW_WARNING,
Classification.TELEGRAM_EARTHQUAKE
]
});
Want to help out? Here's some things I need done:
- Clean up the code a bit
- Document functions
- Bug-hunting
Bug-hunting specifically is a tricky one, since we never know when earthquakes will occur or what their outcomes will be.
0.1.6-beta
5 months ago
0.1.5-beta
5 months ago
0.1.4-beta
5 months ago
0.1.3-beta
5 months ago
0.1.2-beta
5 months ago
0.1.1-beta
5 months ago
0.1.0-beta
5 months ago