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

@doedja/kbbi-js

v2.0.0

Published

JavaScript library and CLI for the official KBBI (Kamus Besar Bahasa Indonesia) dictionary. Anonymous lookups out of the box, optional cookie auth for etymology.

Readme

KBBI-JS

Unofficial JavaScript library and CLI for the official Kamus Besar Bahasa Indonesia at kbbi.kemendikdasmen.go.id. Anonymous lookups out of the box, optional login for etymology data.

Highlights

  • No account required. Anonymous lookups return the full meanings, word classes, and examples.
  • No browser required. Native fetch (Node 18+) by default. The Playwright path is optional and only loads when you ask for it.
  • Lean install. ~9 MB of dependencies, zero Chromium download in the default flow.
  • Fast. Single lookup in under 1 second; a 13-word batch finishes in around 3 seconds at --concurrency 4.
  • Programmatic login. Login is a plain HTTPS POST against the ASP.NET MVC form. No headless browser needed.
  • Batch CLI. Pass multiple words on one command; results are emitted as a JSON array or formatted text.

Why version 2

The KBBI portal moved from kbbi.kemdikbud.go.id to kbbi.kemendikdasmen.go.id after the Indonesian ministry was reorganised, and the old hostname is no longer in DNS. Version 2 retargets the new host, removes the hard Playwright dependency, and exposes the cookie path as opt-in (it was treated as required in 1.x).

Installation

# Default install. No Chromium download.
npm install -g @doedja/kbbi-js

# One-off, no install:
npx @doedja/kbbi-js cinta

Need the optional browser fallback?

npm install playwright
npx playwright install chromium

CLI

kbbi cinta
kbbi cinta makan air                     # batch, parallel
kbbi cinta --json
kbbi cinta --scrape --json               # adds eid + etymology when logged in
kbbi --login --email [email protected] --password '...'
kbbi --cookie-manage list
kbbi --cookie-manage add:AspNetCookieValue
kbbi --cookie-manage delete:AspNetCookieValue
kbbi cinta --browser                     # optional Playwright path
kbbi --help

Anonymous JSON output:

{
  "kata": "cinta",
  "host": "kbbi.kemendikdasmen.go.id",
  "authenticated": false,
  "entri": [
    {
      "nama": "cin.ta",
      "nomor": "",
      "id": null,
      "akarkata": "",
      "jenis": "",
      "makna": [
        {
          "definisi": "suka sekali; sayang benar",
          "kelaskata": [{ "kode": "a", "nama": "Adjektiva" }],
          "contoh": [
            { "nomor": 1, "teks": "orang tuaku -- kepada kami semua" },
            { "nomor": 2, "teks": "-- kepada sesama makhluk" }
          ]
        }
      ],
      "etimologi": null,
      "turunan": [],
      "gabungan": [],
      "peribahasa": [],
      "idiom": []
    }
  ],
  "mirip": []
}

When more than one word is given, the command emits a JSON array (one record per word). Failed lookups are reported as { "kata": "...", "error": "..." } entries and set a non-zero exit code.

What anonymous vs authenticated unlocks

| Field | Anonymous | Logged in | | --------------------- | --------- | --------- | | nama, nomor | Yes | Yes | | makna definitions | Yes | Yes | | kelaskata | Yes | Yes | | contoh examples | Yes | Yes | | etimologi | No (gated by KBBI server) | Yes | | turunan, gabungan, peribahasa, idiom | No (KBBI hides them) | Yes | | id (eid) | No (hidden in edit links) | Yes | | --scrape Phase 2 (/DataDasarEntri/Details) | Skipped (server redirects to login) | Followed |

JavaScript API

const KBBI = require('@doedja/kbbi-js');

(async () => {
  const kbbi = new KBBI(); // no options needed
  const result = await kbbi.lookup('cinta');
  console.log(result.authenticated, result.entries.length, 'meanings');
})();

Optional configuration:

const kbbi = new KBBI({
  useBrowser: false,   // set true to force the Playwright fallback
  headless: true,
  debug: false,
  timeout: 20000
});

With stored cookies (optional)

const Auth = require('@doedja/kbbi-js/lib/auth');
const auth = new Auth();
await auth.addCookie('AspNetCookieValue');
const kbbi = new KBBI({ auth });

Programmatic login (no browser)

const auth = new Auth();
await auth.login('[email protected]', 'secret');
// Cookie is now persisted under data/kbbi-cookies.json and reused on next lookups.

How it works

  1. CLI parses positional args as words and any --flag value pairs.
  2. Each lookup hits https://kbbi.kemendikdasmen.go.id/entri/<word> via fetch.
  3. lib/parser.js (Cheerio) walks the h2[style*="margin-bottom:3px"] headings and their following <ol> / <ul> lists into { nama, nomor, makna[], etimologi, terkait }.
  4. --scrape adds a per-eid call to /DataDasarEntri/Details for callers that supplied a session cookie. The endpoint redirects anonymous callers to /Account/Login, so it is skipped silently in that case.
  5. --browser swaps step 2 for a headless Chromium via Playwright. Use it only if KBBI ever fronts the site with Cloudflare or another JS challenge.

Notes

  • KBBI gates some data (etymology, derivations, idioms, edit-page IDs) to logged-in accounts on the server side. There is no way to retrieve those fields without a session cookie.
  • Login uses a normal ASP.NET MVC POST with the __RequestVerificationToken cookie + form-token pair. No captcha as of this writing; if KBBI adds one, the --browser --login combination (after installing Playwright) is the fallback.
  • The legacy --save-cookie, --add-cookie, and --list-cookies flags from 1.x were dropped in favour of --cookie-manage. Calling --login now expects --email and --password.

License

MIT