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

Package detail

microsoft-capitalize

Kikobeats102.9kMIT1.0.5

Sentence-style capitalization in titles and headings based on Microsoft Styleguide

capitalization, capitalize, microsoft, style, styleguide, title, titleize

readme

microsoft-capitalize


microsoft-capitalize

Last version Build Status Coverage Status Bundlephobia NPM Status

Sentence-style capitalization in titles and headings based on Microsoft Styleguide.

  • Capitalize the first word of a sentence.
  • Be possible to omit specific exceptions.
  • Use lowercase for everything else.

Install

$ npm install microsoft-capitalize --save

Usage

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, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.5 (2020-12-17)

1.0.4 (2020-12-17)

Bug Fixes

  • avoid dot followed by number (0c5775e)

1.0.3 (2020-08-01)

Bug Fixes

  • ensure first word is capitalized (18b9eef)

1.0.2 (2020-07-24)

Bug Fixes

1.0.1 (2020-05-07)

1.0.0 (2020-05-07)

0.0.2 (2020-05-07)

0.0.1 (2020-05-07)