@ashisj/string-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

String Utils

A simple TypeScript package for string manipulation.

Installation

npm install @ashisj/string-utils

USage

import { capitalizeWords, reverseString, countWords } from '@ashisj/string-utils';

// Capitalize words
console.log(capitalizeWords('hello world')); // Output: "Hello World"

// Reverse string
console.log(reverseString('hello')); // Output: "olleh"

// Count words
console.log(countWords('hello world')); // Output: 2

API

capitalizeWords(str: string): string

Capitalizes the first letter of each word in a string

reverseString(str: string): string

Reverses all characters in a string.

countWords(str: string): number

Counts the number of words in a string.

Package Sidebar

Install

npm i @ashisj/string-utils

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

2.03 kB

Total Files

4

Last publish

Collaborators

  • ashisj