isapo

A simply utility method for checking if a zip or state code is APO (Military). Useful for shipping methods that need to determine if USPS should be used.

Usage no npm install needed!

<script type="module">
  import isapo from 'https://cdn.skypack.dev/isapo';
</script>

README

isapo

A very tiny function for testing zipcodes and state codes to determine if they're APO (Military). Sometimes you just need to know if it's APO! Some companies only ship using USPS if the destination is APO, and this little method allows you to check without having to hit the USPS shipping estimate api which saves a small bit of time and removes one step in running constant shipping estimates.

Build Status dependencies Status devDependencies Status License: MIT

Sponsored by Falcon Northwest and Impossible Bureau

Simple example of how to use isapo library

It's simple!

import isZipAPO, { isStateAPO } from '../src';

isApo(340345) // returns true
isApo(84111) // returns false

isZipApo('WA') // returns false
isZipApo('AA') // returns true

Features

  • ES6/ESNext - Write ES6 code and Babel will transpile it to ES5 for backwards compatibility
  • Test - Mocha with Istanbul coverage
  • Lint - Preconfigured ESlint with Airbnb config
  • CI - TravisCI configuration setup
  • Minify - Built code will be minified for performance

Commands

  • npm run clean - Remove lib/ directory
  • npm test - Run tests with linting and coverage results.
  • npm test:only - Run tests without linting or coverage.
  • npm test:watch - You can even re-run tests on file changes!
  • npm test:prod - Run tests with minified code.
  • npm run test:examples - Test written examples on pure JS for better understanding module usage.
  • npm run lint - Run ESlint with airbnb-config
  • npm run cover - Get coverage report for your code.
  • npm run build - Babel will transpile ES6 => ES5 and minify the code.
  • npm run prepublish - Hook for npm. Do all the checks before publishing your module.

License

MIT © Impossible Bureau