hsutil
TypeScript icon, indicating that this package has built-in type declarations

3.8.0 • Public • Published

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

Dependents (8)

Package Sidebar

Install

npm i hsutil

Weekly Downloads

61

Version

3.8.0

License

MIT

Unpacked Size

319 kB

Total Files

46

Last publish

Collaborators

  • masterscripter