0.0.4 • Published 6 years ago

stringr.js v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

stringr.js

Stringr.js provides a simple way to handle strings in your client side application, formatting them through a fairly intuitive interface to use.

Install

You can install Stringr.js using npm with this simple command:

npm i --save stringr.js

Usage:

Stringr.js provides a fairly simple interface to use for developers, you just have to import the function you need to use and that's it. The available functions are as follows:

camelCasetoNaturalSentence

With this you can format strings like "thisIsMyString" to "This is my string". You can pass a second parameter with any separator to add to the sentence, by default it use a blank.

import { camelCaseToNaturalSentence } from "stringr.js";

const myString = "thisIsASimpleStringForTest";

const myFormattedString = camelCaseToNaturalSentence(myString); 
//This return "This is a simple string for test"

const myFormattedUnderscoreString = camelCaseToNaturalSentence(myString, "_"); 
//This return "This_is_a_simple_string_for_test"

const myFormattedDotString = camelCaseToNaturalSentence(myString, ".");
//This return "This.is.a.simple.string.for.test"
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago