https://github.com/ideal-postcodes/capitalise-post-town
Capitalise UK Post Towns
https://github.com/ideal-postcodes/capitalise-post-town
Last synced: 3 months ago
JSON representation
Capitalise UK Post Towns
- Host: GitHub
- URL: https://github.com/ideal-postcodes/capitalise-post-town
- Owner: ideal-postcodes
- Created: 2016-08-15T11:22:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T20:01:08.000Z (over 3 years ago)
- Last Synced: 2026-01-19T15:40:17.374Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.6 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
 [](https://codecov.io/gh/ideal-postcodes/capitalise-post-town)  
# Capitalise UK Post Towns
[](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