1.1.0 • Published 4 years ago

axl-js-toolbox v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

axl-js-toolbox

0 dependency snippets and utilities for web and node projects

jsdoc provided

graceLog

Tiny but configurable log utility for both node and web projects

fn / propvaluesdefaultdesc
graceLog.lvl0|1|2process.env.GRACE_LOG_LEVEL || window.GRACE_LOG_LEVEL || 00 - log, 1 - debug, 2 - verbose
graceLog.fn{function}console.loglog sink function
graceLog.prefix{string}GraceLogactually a key to include in all logs
graceLog.log(...args){*} | args will be passed to graceLog.fn always
graceLog.debug(...args){*} | log args will be passed to graceLog.fn only if lvl > 0
graceLog.verbose(...args){*} | log args will be passed to graceLog.fn only if lvl > 1
graceLog(...args){*} | short-hand for graceLog.log(...args)
graceLog.error(e){string|Error} | logs message and exits process (on node) or throws Error on web

async

Tiny async utility methods

fn / propdescreturns / resolves
promiseSequenceResolves promises/function set in sync (one by one). Passes result of each to another. Alternatively, if function/promise did not return result - it can pass previous result to one after. Behaviorally similar to async array.reduce.Promise<*> - Whatever last promise returns
waitUntilKeeps checking condition in configurable interval. Resolves as soon as condition returns positive valuePromise<*>
debouncePrevents your function from being called too often, by wrapping it with timeout buffer. Every call to it more frequent than timeout bounces actual execution for another timeout After timeout function is executed normally, with "latest" arguments that were passed to it.function
1.1.0

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago