OrchestrationTools
Collection of orchestration-tools
that help building an infrastructure or to orchestrate resources through NodeJS. Also comes with universal tools such as collections.
Version | Coverage | Vulnerabilities | Master | Master-pre-v2.0.0 |
---|---|---|---|---|
Install from npm
This package can be installed using the following command: npm install sh.orchestration-tools
.
Please note that between v1.8.0
and v2.0.0
there were breaking changes regarding Progress
itself and how it is handled in conjunction with Job
. If you therefore need to stick with v1.x.x
, please use the latest stable from the master-pre-v2.0.0
-branch.
Current list of included tools
- Job - a class that can encapsulate and represent any (asynchronous) work. Supports
Promise
-based work, enhanced states, simple eventing and progress. As ofv2.1.0
, JobWithCost has been removed and cost is now supported by Job. - JobQueue - a queue that supports parallel jobs with free degree of parallelism.
- JobQueueCapabilities - an extension to the
JobQueue
that can manage and run jobs based on their cost, rather than on plain parallelism. - Progress - a class used to report any kind of (generic) progress. Supports callbacks, events and
Observables
throughRxJS
. - ProgressNumeric - an extension (and simplification) of
Progress
especially for numeric progress. - CalendarScheduler and Calendar provide mechanism to schedule jobs based on
iCal
-calendars from any source (new inv1.4.0
). - IntervalScheduler and Interval provide a scheduling mechanism to schedule using timeouts or intervals (new in
v1.6.0
). Also, the schedulers now have a common base-class (Scheduler
) and their schedules have one, too (Schedule
). - ProcessWrapper and related classes (such as
ProcessResult
andProcessOutput
) to encapsulate child processes and let them run asPromises
orObervable
s (sincev1.8.0
). - Resolve - a class containing helpers to determine types of variables and to resolve functions and
Promise
s to values of any type (sincev2.6.0
). - ManualScheduler and ManualSchedule provide mechanisms that align with the scheduler-concept and allow to trigger events manually (since
v2.7.0
). - Collection, Queue, ConstrainedQueue (a queue with limited size), ProducerConsumerQueue (a queue where producers add (defer if full) and consumers obtain items (defer if empty), since
v2.30.0
), Stack, ConstrainedStack (a stack with limited size, sincev2.28.0
) and LinkedList*/LinkedListNode* provide fully tested collections that are often needed in JavaScript (sincev2.9.0
/*v2.10.0
) - Dictionary and Cache (which extends it) are fully generic dictionaries that support strings and
Symbol
s as keys. Cache is a capacity-constrained dictionary that supports eviction-policies such asLRU/MRU
,LFU/MFU
,FIFO/LIFO
etc. Also, it supports eviction based on an optional timeout per value (like a weak map) (sincev2.21.0
; both are deprecated, use DictionaryMapBased and CacheMapBased instead as ofv2.22.0
) - CacheWithLoad, an extension of CacheMapBased that introduces a second concept of size constrainment based on a load (since
v2.22.0
). - EqualityComparer and DefaultEqualityComparer are used within the collections to provide default- and custom-capabilities for comparing items (since
v2.9.0
) - Comparer and DefaultComparer to equate items in terms of size (e.g. for sorting) (since
v2.10.0
) - formatValue, formatError, wrapError and throwError are the first of new tools for values and Errors (since
v2.19.0
)