greece-postal-code

1.0.0 • Public • Published

greece-postal-code Build Status Coverage Status npm

Validation of postal codes used in Greece.

Έλεγχος εγκυρότητας ενός ελληνικού ταχυδρομικού κώδικα.

Installation

$ npm install greece-postal-code

Usage

To validate a postal code:

var postalCode = require('greece-postal-code');
 
postalCode.validate('10188'); // true
postalCode.validate('ab1234'); // false

Please note that the validation is strict, for example it will not allow spaces. Use clean() to remove any whitespace from the postal code string before validating it:

postalCode.validate('101 88 '); // false
var cleaned = postalCode.clean('101 88 '); // '10188'
postalCode.validate(cleaned); // true

License

MIT

/greece-postal-code/

    Package Sidebar

    Install

    npm i greece-postal-code

    Weekly Downloads

    220

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • alefteris