Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rahgurung/india-state-codes
🇮🇳 A library to help you search, validate, and convert between India state names and state codes.
https://github.com/rahgurung/india-state-codes
india nodejs-modules states
Last synced: 15 days ago
JSON representation
🇮🇳 A library to help you search, validate, and convert between India state names and state codes.
- Host: GitHub
- URL: https://github.com/rahgurung/india-state-codes
- Owner: rahgurung
- License: mit
- Created: 2020-04-26T07:30:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T20:17:28.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T03:18:16.816Z (3 months ago)
- Topics: india, nodejs-modules, states
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/india-state-codes
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# india-state-codes
[![version](https://img.shields.io/npm/v/india-state-codes)](https://npmjs.org/package/india-state-codes)
A library to help you search, validate, and convert between India state names and state codes.
## Installation
```sh
npm install india-state-codes --save
```## Usage
```javascript
var states = require('india-state-codes');states.sanitizeStateCode('PB.') // PB
states.sanitizeStateName('(PunJAB) ') // Punjab
states.getStateNameByStateCode('...MH.=') // Maharashtra
states.getStateCodeByStateName('!D#!%e123132lhi') // DL (Delhi)
```
## Inspired from
https://github.com/mdzhang/us-state-codes