Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ideal-postcodes/capitalise-post-town

Capitalise UK Post Towns
https://github.com/ideal-postcodes/capitalise-post-town

Last synced: 10 days ago
JSON representation

Capitalise UK Post Towns

Awesome Lists containing this project

README

        

![CI](https://github.com/ideal-postcodes/capitalise-post-town/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/ideal-postcodes/capitalise-post-town/branch/master/graph/badge.svg)](https://codecov.io/gh/ideal-postcodes/capitalise-post-town) ![Dependencies](https://img.shields.io/david/ideal-postcodes/capitalise-post-town.svg?style=flat) ![Size](https://img.shields.io/bundlephobia/min/capitalise-post-town.svg?style=flat)

# Capitalise UK Post Towns

[![Try capitalise-post-town on RunKit](https://badge.runkitcdn.com/capitalise-post-town.svg)](https://npm.runkit.com/capitalise-post-town)

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

- [Get browser ready JS bundles](https://github.com/ideal-postcodes/capitalise-post-town-bundled)

## Install

```
npm install capitalise-post-town
```

## Usage

```javascript
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