pincode-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

pincode-js

A lightweight JS module for parsing and validating postcodes. Country specific validation is supported for most countries including GB, US, Canada, Japan and many others.

Install

npm install pincode-js

Usage

// commonjs
const { pincodeValidator, pincodeValidatorExistsForCountry } = require('pincode-js');
// ES6
import { pincodeValidator, pincodeValidatorExistsForCountry } from 'pincode-js';

pincodeValidator('W85TT', 'GB'); // returns true
pincodeValidator('1234567', 'GB'); // returns false

pincodeValidatorExistsForCountry('GB'); // returns true
pincodeValidatorExistsForCountry('Moon'); // returns false

country codes: US, GB, CA, JP, INTL(International), etc

Package Sidebar

Install

npm i pincode-js

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

30.6 kB

Total Files

13

Last publish

Collaborators

  • tathagat-m