forked from metarhia/metasync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetasync.js
26 lines (22 loc) · 856 Bytes
/
metasync.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
const common = require('@metarhia/common');
const nodeVerion = common.between(process.version, 'v', '.');
const submodules = [
'composition', // Unified abstraction
'adapters', // Adapters to convert different async contracts
'array', // Array utilities
'chain', // Process arrays sync and async array in chain
'collector', // DataCollector and KeyCollector
'control', // Control flow utilities
'do', // Simple chain/do
'fp', // Async utils for functional programming
'memoize', // Async memoization
'poolify', // Create pool from factory
'queue', // Concurrent queue
'throttle', // Throttling utilities
].map(path => require('./lib/' + path));
if (nodeVerion >= 10) {
submodules.push(require('./lib/async-iterator'));
}
const { compose } = submodules[0];
module.exports = Object.assign(compose, ...submodules);