0.0.2 • Published 4 years ago

@saorcode/postcode-utils v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

postcode-utils

A collection of utilities for dealing with postcodes formatted for the Republic of Ireland.

Installation

npm install @saorcode/postcode-utils --save

Usage

Validating and parsing a postcode

import { parsePostcode } from "@saorcode/postcode-utils"

let postcode = parsePostcode("Y35 KD93")
let { routingKey, identifier} = postcode

console.log(`Routing key: ${routingKey}`)
console.log(`Identifier: ${identifier}`)
console.log(`Matches known routing key? ${postcode.routingKeyIsKnown}`)

License

Licensed under the MIT license. See LICENSE.md for terms.