@ianbalijawa16/str-man
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ianbalijawa16/str-man

A lightweight, dependency-free TypeScript library for string utilities.

Installation

npm install @ianbalijawa16/str-man

Features

  • Case Conversions
  • String Validations
  • String Truncation and Padding

Usage

Case Conversions

import { toCamelCase, toSnakeCase, toKebabCase, toPascalCase } from '@ianbalijawa16/str-man';

console.log(toCamelCase('hello world')); // 'helloWorld'
console.log(toSnakeCase('helloWorld')); // 'hello_world'
console.log(toKebabCase('HelloWorld')); // 'hello-world'
console.log(toPascalCase('hello world')); // 'HelloWorld'

Validations

import { isValidEmail, isValidURL, isAlphanumeric } from '@ianbalijawa16/str-man';

console.log(isValidEmail('test@example.com')); // true
console.log(isValidURL('https://example.com')); // true
console.log(isAlphanumeric('Hello123')); // true

String Manipulation

import { truncate, padString } from '@ianbalijawa16/str-man';

console.log(truncate('Hello World', 5)); // 'Hello...'
console.log(padString('123', 5)); // '123  '
console.log(padString('123', 5, '0', 'left')); // '00123'

License

MIT

Package Sidebar

Install

npm i @ianbalijawa16/str-man

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

10.4 kB

Total Files

8

Last publish

Collaborators

  • ianbalijawa16