Skip to content

ideal-postcodes/capitalise-post-town

Folders and files

NameName
Last commit message
Last commit date
May 27, 2021
Feb 18, 2021
Feb 18, 2021
Nov 11, 2019
Feb 19, 2019
Apr 23, 2021
Apr 23, 2021
Feb 12, 2019
Oct 16, 2022
Apr 24, 2022
Mar 14, 2019

Repository files navigation

CI codecov Dependencies Size

Capitalise UK Post Towns

Try capitalise-post-town on RunKit

Small JavaScript library and test suite that will properly capitalise post town names

Takes into account odd peculiar naming rules and exceptions

Input needs to be correctly spaced and/or hyphenated

Links

Install

npm install capitalise-post-town

Usage

const { capitalisePostTown } = require("capitalise-post-town");

// Simple Case
capitalisePostTown("DRYBROOK") // => Drybrook

// Hypenated
capitalisePostTown("HENLEY-IN-ARDEN") // => Henley-in-Arden

// Minor uncapitalised words
capitalisePostTown("WALTON on THE naze") // => Walton on the Naze

// Exception
capitalisePostTown("BO'NESS") // => Bo'Ness
capitalisePostTown("BFPO") // => BFPO

Licence

MIT