npm.io
3.8.0 • Published 5 years ago

hsutil

Licence
MIT
Version
3.8.0
Deps
0
Size
312 kB
Vulns
0
Weekly
0

hsUtil

NPM License npm version docs Build Status codecov Known Vulnerabilities Dependencies Status

Helpful Scripts utility functions for use in both browser and node environments

Installation

npm i hsutil

Provided Functions - no external dependencies:

  • Pacing functions that
    • paces a series of function calls to not occur faster than a preset rate not issue more unresolved calls then a preset limit.
    • provide delays and timeouts for promises.
  • CheckSum a quick checksum implementation for small strings
  • Date printf-style date formatting function
  • uniquefy removes duplicates from arrays, as defined by a selectable key
  • log console.log - style logging utility supporting
    • module-level logging and configuration of module IDs and time stamp format
      log.inform('passed'); // -> 20200516 11:21:54 myModule INFO passed
    • global and module-level filtering of the severity of log outputs: debug, inform, warn, error
    • optional functional call type to avoid compiling messages that will be filtered
      log,inform(()=>passed);
    • colored log messages, by severity
    • colored inspect output, by indentation level
    • configurable message-middle truncating to limit maximum message length

See docs for details