Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-bharat

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-bharat

A list of states,uts,districts and other information of India

  • 1.0.0-1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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. 👍

You can make contributions without breaking changes.Please read the Code-Of-Conduct

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

Last Updated: 08-04-2022

Keywords

FAQs

Package last updated on 09 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc