nodejs-util-lib

    0.1.6 • Public • Published

    NodeJS Utility Library

    Node.js Package CodeQL Test

    Available Utility Types:

    • String Utilities
    • Timer Utilities

    Usage Example:

    const { 
      StringUtils, 
      TimerUtils
    } = require('nodejs-util-lib');
    

    String Utility Functions:

    contains(value, match, caseSensitive=false) - Checks if a string contains another string.

    isEmpty(value, ignoreWhiteSpace=false) - Checks if a value is undefined, null or empty.

    prettyPrintJSON(object, spacing=2) - Returns an object as a nice string formatted JSON string.

    replaceAll(value, valueToReplace, replaceWith) - Replaces all matched values of a string.

    splitAndTrimString(value, delimiter=',') - Splits a string delimited list of strings into an array.

    Timer Utility Functions:

    formatTime(milliseconds) - Converts a time in milliseconds to a nice formatted string.

    getTimeDifferenceString(start, end=Date.now()) - Used to nicely print the time difference between 2 times(milliseconds).

    Keywords

    none

    Install

    npm i nodejs-util-lib

    DownloadsWeekly Downloads

    4

    Version

    0.1.6

    License

    ISC

    Unpacked Size

    8.06 kB

    Total Files

    7

    Last publish

    Collaborators

    • uranakam