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

zipcodes-nearby-boost

v1.0.1

Published

Find a list of zipcodes within a certain distance of a given zipcode.

Downloads

30

Readme

NPM Downloads NPM Version License

Zipcodes near by (Boosted version)

Find a list of zipcodes within a certain distance of a given zipcode.

Installation

npm install zipcodes-nearby-boost

Usage

The method near(zipcode|coordinates, distance[, options]) takes 2 to 3 arguments.

  • First is the zipcode or geo-coordinates (long/lat) to search around
  • Second is the distance (in meters) to search within
  • Third is an optional object with the following attributes:
    • datafile: name for the CSV file containing zipcodes coordinates. By default it looks for a file zipcodes.csv in the same folder
    • zipcode: name of the column in the CSV file containing the zipcode. By default it is Zipcode
    • long: name of the column in the CSV file containing the zipcode longitude. By default it is Long
    • lat: name of the column in the CSV file containing the zipcode latitude. By default it is 'Lat'

For examples:

const zipcodes = require('zipcodes-nearby-boost');

// find zipcodes within 10km from 95020 using the default datafile "zipcodes.csv"
nearby = await zipcodes.near('95020', 10000);

// find zipcodes within 10km from a location given by geo-coordinates using the default datafile "zipcodes.csv"
nearby = await zipcodes.near({ longitude: 78.8, latitude: 48.3 }, 10000);

Data file

The data file with zipcodes coordinates must be supplied. We have include one for USA to use. It can be replaced by zipcodes (or postal codes) from any country as long as the file contains the zipcode, the longitude, and the latitude.

You can download an updated file for the USA at http://federalgovernmentzipcodes.us/

License

MIT

Author Information

Quoc Vu

  • https://linkedin.com/in/quocvu
  • https://github.com/quocvu

Boost Version Author Information

Vorobyov Yuriy

  • https://linkedin.com/in/yuriy-vorobyov-b27b871a8/
  • https://github.com/yuriyvorobyov96