# postcodejs

> A worldwide postcode description library

Latest version **1.2.3** (published 2026-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcodejs
pnpm add postcodejs
yarn add postcodejs
bun add postcodejs
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2026-01-21 |
| First published | 2018-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fan Long |
| Maintainers | congyuli, huaicheng-liu, cctv1237 |

## Links

- npm: https://www.npmjs.com/package/postcodejs
- Repository: git@github.com:storehubnet/postcodejs
- npm.io page: https://npm.io/package/postcodejs

## Recent versions

- 1.2.3 (latest) — 2026-01-21
- 1.1.7-beta.1 (beta) — 2021-07-08
- 1.2.1 — 2026-01-16
- 1.1.8 — 2023-04-04
- 1.1.7 — 2021-08-19
- 1.1.6 — 2020-07-29
- 1.1.5 — 2019-10-23
- 1.1.4 — 2019-10-22
- 1.1.3 — 2019-10-17
- 1.1.2 — 2019-10-16
- 1.1.1 — 2019-07-09
- 1.1.0 — 2019-02-26
- 1.0.0 — 2018-12-26
- 0.2.1 — 2018-11-28
- 0.2.0 — 2018-11-26
- … 11 more at https://npm.io/package/postcodejs/versions

## README

# postcodejs

[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)
![npm](https://img.shields.io/npm/v/npm.svg)
[![NPM](https://nodei.co/npm/postcodejs.png?compact=true)](https://nodei.co/npm/postcodejs/)


`postcodejs` is a nodejs library for query worldwide postcode descriptions

## Requirements

`postcodejs` works with nodejs 6.9+

## Adding postcodejs to your project

### npm
`npm install postcodejs -s`

## Suportted Countries
`MY`: Malaysia
`TH`: Thailand
`PH`: Philippines

## Usage

```js
  const postcode = require('postcodejs')

  postcode.search('MY', '96')
  postcode.search('MY', 96)

  postcode.postcode('MY', '96507')
  postcode.postcode('MY', 96507)

  //get states or province
  postcode.states('MY')

  postcode.statePostcodes ('MY', 'Sarawak')
  postcode.statePostcodes ('MY', ['Sarawak', 'Kelantan'])
  postcode.statePostcodes ('MY', 'Sarawak', true, false)
  postcode.statePostcodes ('MY', ['Sarawak', 'Kelantan'], true, false)

  postcode.districtPostcodes('MY', 'Padang Terap')
  postcode.cityPostcodes('MY', 'Kangar')
```

## Version
1.1.6

## What's new?
Added Philippines zipcodes!

## Not Support Your Country?
We welcome pull requests and if you have data of your country we are happy for you to jion us~

## License

This code is distributed under the terms and conditions of the [MIT license](LICENSE).

---
_Source: https://npm.io/package/postcodejs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
