Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

capitalise-post-town

ideal-postcodes6.4kMIT3.0.1TypeScript support: included

Capitalise UK post towns correctly

capitalise, Post, Town, UK, Addressing

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

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

changelog

3.0.1 (2021-04-23)

Bug Fixes

  • Release: Trigger release (237aa01)

3.0.0 (2021-02-18)

Bug Fixes

  • tsconfig: Bump tsconfig (1776a26)

chore

  • Node: Drop explicit support for Node 8 (595dcdb)

Features

  • BFPO: Handle BFPO post town (9614a40)

BREAKING CHANGES

  • Node: Node 8 no longer forms part of CI testing

Changelog

Any changes, including backwards incompatible changes will be listed here

2.0.3 (14/03/2019)

  • Standardise tsconfig
  • Standardise tslint
  • Apply new code formatting standards

2.0.2 (12/02/2019)

  • Move typescript into dev dependencies
  • Drop unused dependencies
  • Add runkit example

2.0.1 (08/06/2018)

  • Reduce package size by dropping test and mocha.opts

2.0.0 (08/06/2018)

  • Breaking Change. Module now exports an object with a capitalisation function
// New import method

const { capitalisePostTown } = require("capitalise-post-town");
  • Breaking Change. Location of compiled javascript moved to dist/index.js
  • Typings file available