str-kit-kp
v2.0.3
Published
A utility package for advanced string manipulations such as capitalization, camelCase conversion, kebab-case, trimming, and more.
Downloads
39
Maintainers
Readme
str-kit-kp
str-kit-kp
is a simple and easy-to-use package providing utility functions for string manipulation. It includes functions for capitalizing letters, converting strings to camelCase, kebab-case, and more.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation is done using the
npm install
command:
$ npm install str-kit-kp
Follow our installing guide for more information.
Features
- Capitalize the first letter of a string
- Convert a string to camelCase
- Trim leading/trailing whitespace
- Replace spaces with underscores
- Convert a string to kebab-case
Docs & Community
- GitHub Organization for Official Middleware & Modules
Quick Start
To get started with str-kit-kp, follow these steps:
Install the executable. The executable's major version will match Express's:
$ npm install str-kit-kp
//In JavaScript
const strKit = require('str-kit-kp');
const result = strKit.capitalizeFirstLetter('hello world');
console.log(result); // Output: 'Hello world'
//In TypeScipt
import * as strKit from 'str-kit-kp';
const result: string = strKit.capitalizeFirstLetter('hello world');
console.log(result); // Output: 'Hello world'
const camelCaseResult: string = strKit.toCamelCase('hello world');
console.log(camelCaseResult); // Output: 'helloWorld'
const trimmedResult: string = strKit.trimWhitespace(' some text ');
console.log(trimmedResult); // Output: 'some text'
const underscoredResult: string = strKit.replaceSpacesWithUnderscores('hello world');
console.log(underscoredResult); // Output: 'hello_world'
const kebabCaseResult: string = strKit.toKebabCase('Hello World');
console.log(kebabCaseResult); // Output: 'hello-world'
const capitalizeEveryLetterResult: string = strKit.capitalizeEveryLetter('hello world');
console.log(capitalizeEveryLetterResult); // Output: 'HELLO WORLD'