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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bmkg-wrapper

v2.0.1

Published

Sebuah API wrapper untuk mempermudah akses API data terbuka Badan Meteorologi, Klimatologi, dan Geofisika.

Readme

bmkg-wrapper

CodeFactor Install size GitHub License FOSSA Status

bmkg-wrapper adalah sebuah API wrapper untuk mempermudah akses API data terbuka Badan Meteorologi, Klimatologi, dan Geofisika.

Instalasi

npm install bmkg-wrapper

Penggunaan

ESM

import BMKG from 'bmkg-wrapper';
const bmkg = new BMKG();

CommonJS

const BMKG = require('bmkg-wrapper').default;
const bmkg = new BMKG();

Contoh

import BMKG from 'bmkg-wrapper';
const bmkg = new BMKG();

// Menampilkan data gempa yang baru-baru ini terjadi
async function autoGempa() {
  const res = await bmkg.autoGempa();
  console.log(res);
}

autoGempa();

// Menampilkan data prakiraan cuaca untuk kelurahan Lebak Bulus
async function prakiraanCuaca(kelurahan) {
  const res = await bmkg.prakiraanCuaca(kelurahan);
  console.log(res);
}

prakiraanCuaca('Lebak Bulus');

Wilayah Tersedia

Untuk melihat wilayah yang tersedia silakan untuk mengunjungi pranala berikut.

Hasil

AutoGempa

{
  tanggal: '30 Mar 2025',
  jam: '09:58:35 WIB',
  dateTime: '2025-03-30T02:58:35+00:00',
  coordinates: '5.63,95.47',
  lintang: '5.63 LU',
  bujur: '95.47 BT',
  magnitude: 5.4,
  kedalaman: '10 km',
  wilayah: 'Pusat gempa berada di darat 18 Km TimurLaut Banda Aceh',
  potensi: 'Gempa ini dirasakan untuk diteruskan pada masyarakat',
  dirasakan: 'IV Banda Aceh , IV Aceh Besar, III Takengon, II-III Pidie Jaya, II-III Sabang, II Lhokseumawe, II Aceh Tengah, II Bireun',
  shakemap: 'https://data.bmkg.go.id/DataMKG/TEWS//20250330095835.mmi.jpg'
}

GempaTerkini

[
  {
    tanggal: '30 Mar 2025',
    jam: '09:58:35 WIB',
    dateTime: '2025-03-30T02:58:35+00:00',
    coordinates: '5.63,95.47',
    lintang: '5.63 LU',
    bujur: '95.47 BT',
    magnitude: 5.4,
    kedalaman: '10 km',
    wilayah: 'Pusat gempa berada di darat 18 Km TimurLaut Banda Aceh',
    dirasakan: 'IV Banda Aceh , IV Aceh Besar, III Takengon, II-III Pidie Jaya, II-III Sabang, II Lhokseumawe, II Aceh Tengah, II Bireun'
  },
  ...
]

GempaDirasakan

[
  {
    tanggal: '30 Mar 2025',
    jam: '09:58:35 WIB',
    dateTime: '2025-03-30T02:58:35+00:00',
    coordinates: '5.63,95.47',
    lintang: '5.63 LU',
    bujur: '95.47 BT',
    magnitude: 5.4,
    kedalaman: '10 km',
    wilayah: '18 km TimurLaut BANDAACEH-ACEH',
    potensi: 'Tidak berpotensi tsunami'
  },
  ...
]

DataCuaca

{
  lokasi: {
    adm1: '31',
    adm2: '31.74',
    adm3: '31.74.06',
    adm4: '31.74.06.1002',
    provinsi: 'DKI Jakarta',
    kotkab: 'Kota Adm. Jakarta Selatan',
    kecamatan: 'Cilandak',
    desa: 'Lebak Bulus',
    lon: 106.7789416104,
    lat: -6.3011231926,
    timezone: '+0700',
    type: 'adm4'
  },
  cuaca: [
    [
      {
        datetime: '2025-03-30T00:00:00Z',
        t: 27,
        tcc: 100,
        tp: 0,
        weather: 3,
        weather_desc: 'Berawan',
        weather_desc_en: 'Mostly Cloudy',
        wd_deg: 266,
        wd: 'SW',
        wd_to: 'NE',
        ws: 7.3,
        hu: 83,
        vs: 32349,
        vs_text: '> 10 km',
        time_index: '-1-0',
        analysis_date: '2025-03-30T00:00:00',
        image: 'https://api-apps.bmkg.go.id/storage/icon/cuaca/berawan-am.svg',
        utc_datetime: '2025-03-30 00:00:00',
        local_datetime: '2025-03-30 07:00:00'
      },
      ...
    ],
    ...
  ]
}

Method

bmkg.autoGempa()

  • Mengambil data gempa yang baru-baru ini terjadi.
  • Hasil berupa AutoGempa.

bmkg.gempaDirasakan()

bmkg.gempaTerkini()

bmkg.prakiraanCuaca(kelurahan)

  • kelurahan (string, opsional) - Nama kelurahan/desa. Default Lebak Bulus.
  • Mengambil data prakiraan cuaca dalam waktu 3 hari ke depan.
  • Hasil berupa DataCuaca.

Sumber Daya

Lisensi

Projek ini dirilis dibawah lisensi MIT. Kunjungi file LICENSE untuk detail lebih lanjut.