npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wrs-bmkg

v1.0.1

Published

Wrapper tidak resmi yang digunakan untuk mendapatkan informasi gempa dari WRS-BMKG

Downloads

7

Readme

wrs-bmkg

Wrapper tidak resmi yang digunakan untuk mendapatkan informasi gempa dari WRS-BMKG

Catatan

Wrapper ini bukanlah wrapper resmi yang dibuat oleh pihak-pihak BMKG. Wrapper ini hanya menggunakan API endpoint yang dibuat oleh pihak-pihak BMKG, dan bekerja secara Polling.

Wrapper ini sengaja dibuat hanya untuk pembelajaran semata. dan Tidak bekerja sama dengan BMKG sama sekali. Wrapper ini masih belum dijamin bekerja 100%. Jadi jika anda menemukan bug, Mohon buka isu di Github. Terima kasih.

Installasi

npm install wrs-bmkg

API

module(opt)

Sebuah function untuk membuat listener baru. Nama Event diemit berdasarkan dari endpoint.

  • apiURL - URL / Letak URL Endpoint yang akan digunakan untuk mengirim request ke path datagempa.json, lastQL.json, dan gempaQL.json.

Event: incommingBody

Sebuah event yang biasanya diemit setiap polling dengan respon body.

Event: incommingBody_lastQL

Sama seperti event incommingBody, Namun untuk Gempa Realtime.

Event: Gempabumi (Dari respon endpoint WRS-BMKG)

Sebuah event yang biasanya datang dari respon endpoint WRS-BMKG.

Event: realtime

Sebuah event yang digunakan untuk mendapatkan informasi gempa realtime.

Event: error

Event yang biasanya digunakan untuk menangkap error saat request ke WRS-BMKG.

Event lainnya yang biasanya tidak ada di list ini biasanya direspon dari endpoint WRS-BMKG.

await wrs.gempaQL()

Function yang digunakan untuk mendapatkan histori gempa. Return Array.

wrs.lastAlert

Informasi Alert sebelumnya.

wrs.lastRealtimeQL

Informasi Gempa bumi realtime sebelumnya.

wrs.startPolling(timeout)

Mulai Polling.

Parameter

  • timeout (Number): Nomor untuk mengecek ulang setiap milidetik. Secara default, wrs-bmkg.js mengecek setiap 10 detik.

wrs.stopPolling

Berhenti Polling.

Contoh

const wrs = require("wrs-bmkg")();

wrs.on('Gempabumi', data => console.log(data.description));

wrs.startPolling();