https://github.com/kikobeats/microsoft-capitalize
Sentence-style capitalization in titles and headings based on Microsoft Styleguide
https://github.com/kikobeats/microsoft-capitalize
microsoft-styleguide sentence sentence-style-capitalization
Last synced: 4 months ago
JSON representation
Sentence-style capitalization in titles and headings based on Microsoft Styleguide
- Host: GitHub
- URL: https://github.com/kikobeats/microsoft-capitalize
- Owner: Kikobeats
- License: mit
- Created: 2020-05-07T09:13:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T22:33:33.000Z (almost 4 years ago)
- Last Synced: 2024-04-28T14:05:00.219Z (12 months ago)
- Topics: microsoft-styleguide, sentence, sentence-style-capitalization
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# microsoft-capitalize
![]()

[](https://travis-ci.com/Kikobeats/microsoft-capitalize)
[](https://coveralls.io/github/Kikobeats/microsoft-capitalize)
[](https://bundlephobia.com/result?p=microsoft-capitalize)
[](https://www.npmjs.org/package/microsoft-capitalize)> Sentence-style capitalization in titles and headings based on [Microsoft Styleguide](https://docs.microsoft.com/en-us/style-guide/capitalization).
- Capitalize the first word of a sentence.
- Be possible to omit specific exceptions.
- Use lowercase for everything else.## Install
```bash
$ npm install microsoft-capitalize --save
```## Usage
```js
const capitalize = require('microsoft-capitalize')capitalize('Microlink CDN: Global Edge Cache')
// => 'Microlink CDN: Global edge cache'// handling dot corner cases
capitalize('autopilot 2.5')
// => 'Autopilot 2.5'// passing exceptions
capitalize('JSON+LD & oEmbed', ['oEmbed'])
// => 'JSON+LD & oEmbed'
```## API
### capitalize(input, [exceptions])
#### input
*Required*
Type: `string`The input string to be capitalize.
#### exceptions
Type: `string[]`
A list of words to be excluded.
## License
**microsoft-capitalize** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/microsoft-capitalize/blob/master/LICENSE.md) License.
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/microsoft-capitalize/contributors).> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)