Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.04 KB

README.md

File metadata and controls

48 lines (39 loc) · 1.04 KB

String Instrument

A little library for working with strings.

Installation

npm install --save string-instrument
# yarn add string-instrument
# pnpm add string-instrument

Usage

Camelise

import { camelise } from 'string-instrument'

console.log(camelise('one two_three')) // oneTwoThree
console.log(camelise('one two_three', true)) // OneTwoThree
import {
  dasherise,
  downcaseFirst,
  humanise,
  ordinal,
  ordinalise,
  parameterise,
  pascalise,
  titleise,
  underscore,
  upcaseFirst
} from 'string-instrument'

console.log(dasherise('hello_world')) // hello-world
console.log(downcaseFirst('Hello World')) // hello World
console.log(humanise('hello_world')) // hello world
console.log(ordinal(1)) // st
console.log(ordinalise(1)) // 1st
console.log(parameterise('Hello World')) // hello-world
console.log(pascalise('hello_world')) // HelloWorld
console.log(titleise('hello world')) // Hello World
console.log(underscore('helloWorld')) // hello_world
console.log(upcaseFirst('hello world')) // Hello world