String Utils
This package provides easy to use string utility functions that provide more functionality above and beyond normal
string functions. These functions can be imported individually, without instantiation.
Installation
To install this package you can simply use the install command below.
$ npm i --save skaleb-string-utils
Usage
reverse(string)
reverses and returns the given string.
import { reverse } from './index'
return reverse('some string')
capitalCase(string)
capitalizes each individual word in a given string and returns the new string.
import { capitalCase } from './index'
return capitalCase('some or other string')
camelCase(string)
converts the given string to camelCaseFormat and returns it.
import { camelCase } from './index'
return camelCase('This is now camel case')
toBinary(string, ?deliminate)
converts the given string or sentence into binary code. This by default is returned as
a single string however the response can be set to be deliminated.
import { toBinary } from './index'
import { Delimination } from './enums/Delimination'
return toBinary('some binary')
return toBinary('some binary', Delimination.SPACES)
return toBinary('some binary', Delimination.ORIGINAL)
toHexadecimal(string, ?deliminate)
converts the given string or sentence into hexadecimal. This be default is returned
as a single string however the response can be set to be deliminated.
import { toHexadecimal } from './index'
import { Delimination } from './enums/Delimination'
return toHexadecimal('hexadecimal')
return toHexadecimal('some hexadecimal', Delimination.SPACES)
return toHexadecimal('some hexadecimal', Delimination.ORIGINAL)
Tests
This project is completely covered by unit tests. Various cases have been accounted for both in the codebase and in the
tests covering it. If a bug is picked up regarding the test suite or code, feel free to make a contribution to help
correct the bug.
To run the tests, you can simply run the following test
command/s.
$ npm run lint
$ npm run test
$ npm run coverage
Contributions
Feedback and contributions are more than welcome. Should you feel there is something you wish to contribute to this
paginator, feel free to make a merge request. Ensure that whatever proposed change, has tests covering various cases for
the change.