string-instrument

String Instrument

A little library for working with strings.

npm install --save string-instrument
# yarn add string-instrument
# pnpm add string-instrument
import { camelise } from 'string-instrument'

console.log(camelise('one two_three')) // oneTwoThree
console.log(camelise('one two_three', true)) // OneTwoThree
import { dasherise } from 'string-instrument'

console.log(dasherise('one two_three')) // one-two-three
import { downcaseFirst } from 'string-instrument'

console.log(downcaseFirst('One Two Three')) // one Two Three
import { humanise } from 'string-instrument'

console.log(humanise('one two_three')) // one two three
console.log(humanise('one two_three', true)) // One two three
import { ordinal } from 'string-instrument'

console.log(ordinal(1)) // st
console.log(ordinal(42)) // nd
console.log(ordinal(111)) // th
import { ordinalise } from 'string-instrument'

console.log(ordinalise(1)) // 1st
console.log(ordinalise(42)) // 42nd
console.log(ordinalise(111)) // 111th
import {
parameterise,
pascalise,
titleise,
underscore,
upcaseFirst
} from 'string-instrument'

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