npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

points-in-country

v1.1.3

Published

Generate list of points within country

Downloads

9

Readme

points-in-country NPM: Build Status GitHub license

Generate an array of points within a country

Input

Parameters: (country, interval)

country requried

interval optional 0.1 by default

Output

Two dimensional array of points

[
    [lat, lon]
    [lat, lon]
    [lat, lon]
    ...
]

Usage

const pic = require('points-in-country')

const points = pic('Latvia', 0.1)

console.log(points) 
// [ 
//   [ 26.26859785200015, 55.76699086600011 ], 
//   [ 26.36859785200015, 55.76699086600011 ], 
//   [ 26.46859785200015, 55.76699086600011 ],
//   ... 
// ]

Warning

Passing an interval bigger than the longtitude or the latitude of a country will produce an empty array

eg. points-in-country('Vatican', 1) === []

Available countries

Total countries 206

| | | | | | |:----------:|:----------:|:----------:|:----------:|:----------:| | Afghanistan | Central African Republic | Greenland | Palestine | South Sudan | | Akrotiri Sovereign Base Area | Chad | Grenada | Panama | Spain | | Aland | Chile | Guam | Papua New Guinea | Spratly Islands | | Albania | China | Guatemala | Paraguay | Sudan | | Algeria | Clipperton Island | Guernsey | Peru | Suriname | | American Samoa | Colombia | Guinea | Philippines | Swaziland | | Andorra | Comoros | Guinea Bissau | Pitcairn Islands | Sweden | | Angola | Cook Islands | Guyana | Poland | Switzerland | | Anguilla | Coral Sea Islands | Haiti | Portugal | Syria | | Antarctica | Costa Rica | Heard Island and McDonald Islands | Puerto Rico | Taiwan | | Antigua and Barbuda | Croatia | Honduras | Qatar | Tajikistan | | Argentina | Cuba | Hong Kong S.A.R. | Republic of Congo | Thailand | | ArmeniaAruba | Curaçao | Hungary | Republic of Serbia | The Bahamas | | Ashmore and Cartier Islands | Cyprus | Iceland | Romania | Togo | | Australia | Czech Republic | India | Russia | Tonga | | Austria | Democratic Republic of the Congo | Indian Ocean Territories | Rwanda | Trinidad and Tobago | | Azerbaijan | Denmark | Indonesia | Saint Barthelemy | Tunisia | | Bahrain | Djibouti | Iran | Saint Helena | Turkey | | Bajo Nuevo Bank (Petrel Is.) | Dominica | Iraq | Saint Kitts and Nevis | Turkmenistan | | Bangladesh | Dominican Republic | Ireland | Saint Pierre and Miquelon | Turks and Caicos Islands | | Barbados | East Timor | Isle of Man | Saint Vincent and the Grenadines | Tuvalu | | Baykonur Cosmodrome | Ecuador | Israel | Samoa | Uganda | | Belarus | Egypt | Italy | San Marino | Ukraine | | Belgium | El Salvador | Ivory Coast | Sao Tome and Principe | United Arab Emirates | | Belize | Equatorial Guinea | Jamaica | Saudi Arabia | United Kingdom | | Benin | Eritrea | Japan | Scarborough Reef | United Republic of Tanzania | | Bermuda | Estonia | Jersey | Senegal | United States Minor Outlying Islands | | Bhutan | Ethiopia | Jordan | Serranilla Bank | United States of America | | Bolivia | Falkland Islands | Kazakhstan | Seychelles | United States Virgin Islands | | Bosnia and Herzegovina | Faroe Islands | Kenya | Siachen Glacier | Uruguay | | Botswana | Federated States of Micronesia | Kiribati | Sierra Leone | US Naval Base Guantanamo Bay | | Brazil | Fiji | Kosovo | Singapore | Uzbekistan | | British Indian Ocean Territory | Finland | Kuwait | Sint Maarten | Vanuatu | | British Virgin Islands | France | Kyrgyzstan | Slovakia | Vatican | | Brunei | French Polynesia | Laos | Slovenia | Venezuela | | Bulgaria | French Southern and Antarctic Lands | Lebanon | Solomon Islands | Vietnam | | Burkina Faso | Gabon | Liberia | Somalia | Wallis and Futuna | | Burundi | Gambia | Libya | Somaliland | Western Sahara | | Cambodia | Georgia | Northern Cyprus | South Africa | Yemen | | Cameroon | Germany | North Korea | South Georgia and South Sandwich Islands | | | Canada | Ghana | Oman | South Korea | | | Cape Verde | Gibraltar | Pakistan | Zambia | | | Cayman Islands | Greece | Palau | Zimbabwe | |

License

MIT License

Copyright (c) 2019 Tomasz Zielinski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.