@asoviche/my-library
v1.0.0
Published
My awesome TypeScript library
Downloads
22
Readme
my-library
A simple TypeScript library with string utilities.
Installation
npm install my-libraryUsage
import { capitalize, slugify, truncate } from "my-library";
capitalize("hello"); // "Hello"
slugify("Hello World!"); // "hello-world"
truncate("Long text", 5); // "Lo..."API
capitalize(str: string): string
Capitalizes the first letter of a string.
slugify(str: string): string
Converts a string to a URL-friendly slug.
truncate(str: string, length: number, suffix?: string): string
Truncates a string to the specified length, appending a suffix (default: "...").
Development
# Install dependencies
npm install
# Build the library
npm run build
# Watch mode for development
npm run devLicense
MIT
