Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ideal-postcodes/capitalise-post-town
- Owner: ideal-postcodes
- Created: 2016-08-15T11:22:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T20:01:08.000Z (over 1 year ago)
- Last Synced: 2024-10-28T23:37:03.956Z (18 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.6 MB
- Stars: 3
- Watchers: 7
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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