Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jayantur13/data-bharat
- Owner: jayantur13
- License: other
- Created: 2022-04-08T18:29:34.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T19:20:15.000Z (over 2 years ago)
- Last Synced: 2024-09-29T13:40:59.834Z (about 2 months ago)
- Topics: data, js, node, npmjs, package, yarn
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/data-bharat
- Size: 1.72 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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