Get states,districts,Ut's and capitals etc,you'll get data in raw/stringified JSON format
- 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
//Using npm
npm install data-bharat
//Using yarn
yarn add data-bharat
- 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'))