The lightweight pure JavaScript library
npm install g-jslib
$ npm install g-jslib
``
Modules
* LocalStorageMethods
* store(key, value)
* retrieve(key, defaultReturn)
* remove(key)
* removeAll()
* OwnObjectArray
* toJSONString(objectArray)
* toObjectArray(sJSON)
* findIndex(objectArray, sPropertyName, sPropertyValue)
* sortByAlphabet(objectArray, sPropertyName, order)
* sortByNumeric(objectArray, sPropertyName, order)
* filterByProperty(objectArray,sPropertyName,sSeekingValue)
* getMax(objectArray,sPropertyName)
* Utils
* convertStringToInterger(sNumber, fractionDigits)
* getRandomNumber(minNr, maxNr)
* String.prototype
* .toText()
* .limitWords(limitNumber)
* Array.prototype (Using only for object array)
* .toJSONString()
* .findIndexByProperty(sPropertyName, sPropertyValue)
* .sortByAlphabet(sPropertyName, orderKeyword)
* .sortByNumeric(sPropertyName, orderKeyword)
* .filterByProperty(sPropertyName, sSeekingValue)
* .getMax(sPropertyName)
Online demo
* OwnObjectArray
* String.prototype
* Array.prototype
Using
Import the modules you need and String.prototype and Array.prototype are included automatic (recommendation):
import { LocalStorageMethods, OwnObjectArray } from 'g-jslib';
For only using String.prototype or Array.prototype (for object array):
import 'g-jslib';`