capitalize-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Capitalize

A helper in typescript for capitalizing first letter in a string, leaving rest letter untouched

Usage

import { capitalize } from 'capitalize-ts';

capitalize('hello'); // 'Hello'
capitalize('hello, World'); // 'Hello World'

Install

npm install capitalize-ts

Strict Typing

Leverage the built-in Capitalize generic for more precise typing

const result = capitalize('hello');
// type of `result` is Hello instead of string

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    52
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    52

Package Sidebar

Install

npm i capitalize-ts

Weekly Downloads

52

Version

1.0.0

License

MIT

Unpacked Size

6.24 kB

Total Files

16

Last publish

Collaborators

  • everdimension