Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jayantur13/data-bharat

Get states their capital and districts,UTS and other useful information
https://github.com/jayantur13/data-bharat

data js node npmjs package yarn

Last synced: about 1 month ago
JSON representation

Get states their capital and districts,UTS and other useful information

Awesome Lists containing this project

README

        











Get states,districts,Ut's and capitals etc,you'll get data in raw/stringified JSON format



# Features And Methods

- statesWithAbbr/stateWithAbbr - returns state abbreviation,name and is a state or ut
- statesWithCapital/stateWithCapital - returns state and its capital
- statesCapitalslink/stateCapitallnk - returns state,its website,capital and its website
- statesAndDistricts - returns states and their districts
- getRawData - returns complete non-manipulated data

# Installation

```
//Using npm
npm install data-bharat

//Using yarn
yarn add data-bharat
```

# Examples

- getRawData() - @param stringify [String] takes y(yes) or n(no) or ()

```
const call = require('./dataIndia')
//Or directly import the method name

//No param defaults to raw JSON data
console.log(call.getRawData())

//Param y for stringify data
console.log(call.getRawData('y'))

//Param n for raw data
console.log(call.getRawData('n'))
```

- statesWithAbbr - @param stringify [String] takes y(yes) or n(no) or ()

```
const call = require('./dataIndia')
//Or directly import the method name

//No param defaults to raw JSON data
console.log(call.statesWithAbbr())

//Param y for stringify data
console.log(call.statesWithAbbr('y'))

//Param n for raw data
console.log(call.statesWithAbbr('n'))
```

- stateWithAbbr
@param - searchterm [String] takes state name
@param - stringify [String] takes y(yes) or n(no)

```
const call = require('./dataIndia')
//Or directly import the method name

//Valid use #1,return raw json
console.log(call.stateWithAbbr('Assam'))

//Valid use #2,return json stringified
console.log(call.stateWithAbbr('Assam','y'))

//Valid use #3,return raw json
console.log(call.stateWithAbbr('Assam','n'))
```

#### Similarly,try and use other methods

> ### You can get more documentation while using the method on hover

### Using this package in your project ? Want to get added here ? Drop a message. 👍

# Contribution
You can make contributions without breaking changes.Please read the `Code-Of-Conduct` and `Contributing` before doing contribution.

# Support the project
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/jayantur13v)

# License
Licensed under MIT. Please, attribute me and this repo if you use it for any of your purpose

### Last Updated: 18-06-2022