g-jslib

1.2.3 • Public • Published

g-jslib

Download g-jslib on npm

The lightweight pure JavaScript library.

Installation

$ 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

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';

Detail

You may want to view how to use this library on GitHub

Package Sidebar

Install

npm i g-jslib

Weekly Downloads

2

Version

1.2.3

License

MIT

Unpacked Size

11.5 kB

Total Files

4

Last publish

Collaborators

  • nguyenkhois