zippo

1.0.1 • Public • Published

zippo Build Status

ZIP code validation and parsing

Install

$ npm install --save zippo

Usage

var zip = require('zippo')
 
zip.parse('94105abc123')
//=> 94105
 
zip.validate('94105abc123')
//=> false

API

zip.parse(input) -> string

Parses a zip code input by removing non-digit characters and limiting the string to 5 characters.

input

Required
Type: string

zip.validate(input) -> boolean

Validates whether a zip code is 5 digits.

input

Required
Type: string

License

MIT © Ben Drucker

Readme

Keywords

Package Sidebar

Install

npm i zippo

Weekly Downloads

192

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker