Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sahilsahil934/world-countries-population-data
npm package to get population of Countries, regions, world, continent since 1960 to 2020
https://github.com/sahilsahil934/world-countries-population-data
countries hacktoberfest historic nodejs npm population
Last synced: 18 days ago
JSON representation
npm package to get population of Countries, regions, world, continent since 1960 to 2020
- Host: GitHub
- URL: https://github.com/sahilsahil934/world-countries-population-data
- Owner: sahilsahil934
- License: mit
- Created: 2021-10-19T15:12:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-23T15:17:15.000Z (about 3 years ago)
- Last Synced: 2024-12-14T08:52:40.004Z (24 days ago)
- Topics: countries, hacktoberfest, historic, nodejs, npm, population
- Language: JavaScript
- Homepage:
- Size: 506 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WORLD COUNTRIES REGIONS POPULATION DATA
[![version](https://img.shields.io/npm/v/world-countries-population-data)](https://www.npmjs.com/package/world-countries-population-data)
Population data of countries, regions, total world, continents, unions from year 1960 to 2020
## Installing
``` bash
npm i world-countries-population-data
```## Example usage
``` javascript
const data = require('world-countries-population-data')// to get population of each country in a particular year
data.getPopulationByYear(year)// to get population in each year of a particular country
data.getPopulationOfCountry(countryName)// to get population by year and country
data.getPopulationByCountryAndYear(countryName, year)// to get population by country code and optional year (example USA, IND)
const getPopulationByCountryCode = function (countryCode, year = null)// to get population of world by particular year
data.getWorldPopulationByYear(year)// population of world from begging (1960) to year (2020)
data.getWorldPopulationData()
```Feel free to contribute and make it better
## Possible future additions
### Make continent and region data more easily accessible
### Population of countries states and region## How to contribute
These are the steps required:
``` bash
# Clone the repo (or better your fork of it)
git clone https://github.com/iamsahil1910/world-countries-population-data.git
cd world-countries-population-data# Create new branch
git checkout -b new-branchMake Changes
# If all is ok commit and push
git add .
git commit
git push# Then send a pull request with your changes.
```