How to use it

In browser
<script src="textural.min.js"> </script>
In Node.js
npm install textural
var textural = require('textural');

Format

Text can be formatted to any known format such as camelCase, snake_case, slug-case, human case.

Note: you can use upper, lower and capitalize prefix for any kind of format, e.g uppersnake will produce: SNAKE_CASE

Description Format Result
convert to camelCase camel exampleText
convert to snake_case snake example_text
convert to slug-case slug example-text
convert to normal text human example text
truncate letters (change number after t according to your needs) t3 exa

Examples with prefix

Format Result
uppersnake EXAMPLE_TEXT
lowersnake example_text
capitalizesnake Example_Text

Null handler (value to return if no text present)

Note: null handler should be set always at the end of format string, you can put any text you like inside parentheses and also it can be added to any type of format

Format Result
(-) -
lowersnake(No value) No value

Acknowlegements

textural.js was inspired by and heavily borrowed from numeral.js