srilankan-postalcode-backend
v1.0.0
Published
The srilankan-postalcode npm package provides a comprehensive set of utilities for working with Sri Lankan postal codes. It offers functionalities for validation, extraction, and formatting of postal codes, enabling seamless integration into applications
Downloads
12
Maintainers
Keywords
Readme
Sri Lanka Districts Cities Json
Cities by Districts
The srilankan-postalcode npm package provides a comprehensive set of utilities for working with Sri Lankan postal codes. It offers functionalities for validation, extraction, and formatting of postal codes, enabling seamless integration into applications that require precise address management within Sri Lanka. Whether you're building an e-commerce platform, a logistics solution, or any application involving location-based services in Sri Lanka, this package simplifies the process of handling postal codes.
Statistics
- Districts - 25
- Cities - 1990 (still updating)
Cities and Postal-code by District
Statistics
- Districts - 25
- Cities - 1990 (still updating)
- Jaffna, Kilinochchi, Mannar, Mullativu, Vavuniya postal-code still pending.
Cities
- Ampara - 61
- Anuradhapura - 129
- Badulla - 132
- Batticaloa - 46
- Colombo - 80
- Galle - 95
- Gampaha - 125
- Hambantota - 64
- Jaffna - 50
- Kalutara - 81
- Kandy - 165
- Kegalle - 98
- Kilinochchi - 1
- Kurunegala - 201
- Mannar - 26
- Matale - 71
- Matara - 77
- Monaragala - 58
- Mullativu - 17
- Nuwara Eliya - 70
- Polonnaruwa - 62
- Puttalam - 81
- Ratnapura - 118
- Trincomalee - 39
- Vavuniya - 43
Features
- Get all cities
- Get all cities by district
- Get postal-code by city
Browser Support
- Chrome
- Firefox
- Safari
- Opera
- Edge
- IE 11
Installation
npm install srilankan-postalcode
Usage
const postalcode = require("srilankan-postalcode");
// Get all cities
const cities = postalcode.getAllCities();
console.log(cities);
// Get all cities by district
const citiesByDistrict = postalcode.getCitiesByDistrict("Colombo");
console.log(citiesByDistrict);
// Get postal-code by city
const postalCode = postalcode.getPostalCodeByCity("Colombo", "Colombo 01");
console.log(postalCode);
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Keywords
- Sri Lanka
- Sri Lanka Postal Code
- Sri Lanka Postal Code Validation
- Sri Lanka Postal Code Extraction
- Sri Lanka Postal Code Formatting
- Sri Lanka Postal Code Validation