orchestration-tools that help building an infrastructure or to orchestrate resources through NodeJS. Also comes with universal tools such as collections.
Install from npm
This package can be installed using the following command:
npm install sh.orchestration-tools.
The tools come fully typed in JSDoc, and the documentation for all released versions can also be found here: https://mrshoenel.github.io/orchestration-tools/.
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 of
v2.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
JobQueuethat 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
- ProgressNumeric - an extension (and simplification) of
Progressespecially for numeric progress.
- 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 (
- ProcessWrapper and related classes (such as
ProcessOutput) to encapsulate child processes and let them run as
- Resolve - a class containing helpers to determine types of variables and to resolve functions and
Promises to values of any type (since
- ManualScheduler and ManualSchedule provide mechanisms that align with the scheduler-concept and allow to trigger events manually (since
- 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, since
- Dictionary and Cache (which extends it) are fully generic dictionaries that support strings and
Symbols as keys. Cache is a capacity-constrained dictionary that supports eviction-policies such as
FIFO/LIFOetc. Also, it supports eviction based on an optional timeout per value (like a weak map) (since
v2.21.0; both are deprecated, use DictionaryMapBased and CacheMapBased instead as of
- CacheWithLoad, an extension of CacheMapBased that introduces a second concept of size constrainment based on a load (since
- EqualityComparer and DefaultEqualityComparer are used within the collections to provide default- and custom-capabilities for comparing items (since
- Comparer and DefaultComparer to equate items in terms of size (e.g. for sorting) (since
- formatValue, formatError, wrapError and throwError are the first of new tools for values and Errors (since
- Resource and ResourceSelector are used to build pools of resources and to select from them using a strategy, such as least recently used, or Round Robin etc. (since
CalendarScheduler and Calendar provide mechanism to schedule jobs based onThese were removed beginning with
iCal-calendars from any source (new in
v3.0.0and are now to be found in the package
v2.0.0there were breaking changes regarding
Progressitself 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
- Calendar-related tools and its Scheduler were removed in version
v3.0.0and have been moved into the package
sh.misc-tools(available via npm ).