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 🙏

© 2025 – Pkg Stats / Ryan Hefner

indopkkd

v0.0.8

Published

Listing kode provinsi, kabupaten, kecamatan, desa indonesia

Readme

indopkkd

Get Indonesian region details from a region code.


Benefits and Ease of Use

The indopkkd package simplifies retrieving detailed information about Indonesian regions based on standardized region codes. You can access hierarchical region data, including provinces, cities, sub-districts, and villages, without manual parsing of raw data.

Key Benefits:

  • Efficiency: Quickly retrieve detailed region information by code.
  • Accuracy: Maps standardized region codes to correct names.
  • Ease of Use: Simple API functions for easy integration.
  • Scalability: Easily extendable to include more regions or data.

Installation

Install via npm:

npm install indopkkd

Usage

Import and invoke the provided helper functions:

const {
  getRegion,
  getProvinsi,
  getKota,
  getKecamatan,
  getDesa,
  listProvinsi,
  listKota,
  listKecamatan,
  listDesa,
} = require('indopkkd');

1. Get Region Details

const region = getRegion('1101012001');
console.log(region);
// {
//   provinsi: 'ACEH',
//   kab: 'KAB. ACEH SELATAN',
//   kecamatan: 'Bakongan',
//   desa: 'Keude Bakongan'
// }
  • getRegion(regionCode: string)

    • Input: 10-digit numeric string (unformatted).
    • Output: Object with provinsi, kab, kecamatan, desa keys (strings or null).

2. Get Province (Provinsi) Names

const prov = getProvinsi('11');
console.log(prov);
// ['ACEH']
  • getProvinsi(provinsiCode: string)

    • Input: 2-digit code.
    • Output: Array of province names matching the code.

3. Get City (Kota) Names

const cities = getKota('01');
console.log(cities);
// ['KAB. ACEH SELATAN']
  • getKota(kotaCode: string)

    • Input: 2-digit city code.
    • Output: Array of city names matching the code.

4. Get Sub-district (Kecamatan) Names

const subdistricts = getKecamatan('01');
console.log(subdistricts);
// ['Bakongan', 'Kluet Utara']
  • getKecamatan(kecamatanCode: string)

    • Input: 2-digit sub-district code.
    • Output: Array of sub-district names matching the code.

5. Get Village (Desa) Names

const villages = getDesa('2001');
console.log(villages);
// ['Keude Bakongan', 'Fajar Harapan']
  • getDesa(desaCode: string)

    • Input: 4-digit village code.
    • Output: Array of village names matching the code.

Dropdown List Helpers

For hierarchical dropdowns in UI:

listProvinsi()

listProvinsi();
// [{ code: '11', name: 'ACEH' }, ...]
  • Returns array of { code, name } for all provinces.

listKota(provinsiCode)

listKota('11');
// [{ code: '01', name: 'KAB. ACEH SELATAN' }, ...]
  • Filter cities by 2-digit province code.

listKecamatan(kotaCode)

listKecamatan('01');
// [{ code: '01', name: 'Bakongan' }, ...]
  • Filter sub-districts by 2-digit city code.

listDesa(kecamatanCode)

listDesa('01');
// [{ code: '2001', name: 'Keude Bakongan' }, ...]
  • Filter villages by 2-digit sub-district code.

Testing

Include the pre-made test script to validate all functions:

node test/test.js

Output will list results for each helper. Modify or extend the tests as needed.


Versioning

Follow SemVer for version increments:

  • Patch for bug fixes (e.g. npm version patch).
  • Minor for backward-compatible features (e.g. npm version minor).
  • Major for breaking changes (e.g. npm version major).

After bumping version:

git push origin main --tags
npm publish --access public

Contribution Guidelines

  1. Fork the repository and create a feature branch (git checkout -b feature/YourFeature).
  2. Commit your changes (git commit -m 'Add some feature').
  3. Push to the branch (git push origin feature/YourFeature).
  4. Open a Pull Request.

Please follow existing code style and include tests for new functionality.


License

MIT © [fandilladp] 2025