india-state-city 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # india-state-city
2
+
3
+ A lightweight library to get the list of States in India and Cities within those States.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install india-state-city
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Get all States of India
14
+
15
+ ```javascript
16
+ const { State } = require('india-state-city');
17
+
18
+ const states = State.getAllStates();
19
+ console.log(states);
20
+ ```
21
+
22
+ ### Get Cities of a State
23
+
24
+ You need to provide the `stateCode` (e.g., 'MH' for Maharashtra, 'DL' for Delhi).
25
+
26
+ ```javascript
27
+ const { City } = require('india-state-city');
28
+
29
+ const cities = City.getCitiesOfState('MH');
30
+ console.log(cities);
31
+ ```
32
+
33
+ ## API Reference
34
+
35
+ ### State
36
+ - `getAllStates()`: Returns an array of all states in India.
37
+ - `getStateByCode(stateCode)`: Returns details of a specific state by its code.
38
+
39
+ ### City
40
+ - `getAllCities()`: Returns an array of all cities in India.
41
+ - `getCitiesOfState(stateCode)`: Returns an array of cities for a given state code.