1.1.2 • Published 7 years ago

zipcodes-usa v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

zipcodes-usa Build Status Coverage Status

Generate random identity with a valid standard (not P.O. Box or APO) zip code.

Rationale

This package was developed specifically for testing an e-commerce system that requires a valid US zip code for shipping cost calculation. Invalid zip codes, or those designated for Post Office Boxes (or APO) caused unexpected test failures.

Zip code data for this package originated from the US Government.

Other random identity information (name, street address, phone number, email address) is generated from faker

Install

Installation is simple and straightforward:

npm install --save zipcodes-usa

Usage

var zipcodes-usa = require('zipcodes-usa')

zipcodes-usa.random()
// => JSON object with {name, address, city, state, zip, phone, email}

License

This project is licensed under the MIT License

Notes

Added the ability to pull an address from google geocoding: zipcodes-usa.google() It's still experimental, but appears to be working well. It requires a Google API Key to work, you can obtain one here and set it up as local environment variable GOOGLE_KEY

This is an async function, so usage looks like this:

var zips = require('zicodes-usa')

zips.google().then((data) => {
  console.log(data);
  });
	
	// -> {"name": xxxx, "address": xxxx, "city": xxxx, "state": XX, "zipcode": xxxx, "phone": xxxx, "email": xxxx, "company": xxxx}

Future work

In the next iteration, I would like to add:

  • Option to specify state (and/or city)
  • Option to specify zip code type (standard, PO Box, APO)

Contributing

Pull requests and stars are always welcome

For bugs and feature requests, please create an issue

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago