capitalise-post-town

Capitalise UK post towns correctly

Usage no npm install needed!

<script type="module">
  import capitalisePostTown from 'https://cdn.skypack.dev/capitalise-post-town';
</script>

README

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