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

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i capitalize-ts

    Weekly Downloads

    76

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.24 kB

    Total Files

    16

    Last publish

    Collaborators

    • everdimension