zippo
Version:
ZIP code validation and parsing
48 lines (27 loc) • 702 B
Markdown
> ZIP code validation and parsing
```
$ npm install --save zippo
```
```js
var zip = require('zippo')
zip.parse('94105abc123')
//=> 94105
zip.validate('94105abc123')
//=> false
```
Parses a zip code input by removing non-digit characters and limiting the string to 5 characters.
*Required*
Type: `string`
Validates whether a zip code is 5 digits.
*Required*
Type: `string`
MIT © [Ben Drucker](http://bendrucker.me)