Files
  • index.js
  • DB.js
  • businessLogic.js
  • composed.js
  • oldFashion.js
  • reactiveStreams.js
  • streamUtils.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const sumRichTransactionsOldFashion = require('./oldFashion');
const sumRichTransactionsStreams = require('./reactiveStreams');
const sumRichTransactionsComposed = require('./composed');

const main = async () => {
	console.log('Loading all data in memory');
	console.log(await sumRichTransactionsOldFashion());

	console.log('\nUsing streams');
	console.log(await sumRichTransactionsStreams());

  console.log('\nUsing composition');
	console.log(await sumRichTransactionsComposed());
};

main();
node v9.7.1 linux/amd64