git ssb

0+

cel / ssb-activity



Commit cec705118d65476d8ba5b903fb836cae42f2f1dd

Add series argument to process-ids.js

cel committed on 9/6/2020, 2:44:52 PM
Parent: 415e490ab48a6615c75de123434950e754cc5d67

Files changed

README.mdchanged
process-ids.jschanged
README.mdView
@@ -6,7 +6,7 @@
66
77 Building the graph:
88 ```
99 ./run.sh
10-node process-ids.js
11-node run.js
10 +node process-ids.js day
11 +node run.js day
1212 ```
process-ids.jsView
@@ -8,9 +8,12 @@
88 var dayMax = 0
99 var weekMax = 0
1010 var monthMax = 0
1111
12-pull(
12 +var series = process.argv[2]
13 +if (!series) throw new TypeError('Missing series argument')
14 +
15 +if (series === 'day') pull(
1316 File(path.join(__dirname, 'day.jsonp')),
1417 Split(),
1518 pull.filter(Boolean),
1619 pull.map(JSON.parse),
@@ -33,9 +36,9 @@
3336 fs.writeFileSync(path.join(__dirname, 'day.json'), data)
3437 })
3538 )
3639
37-pull(
40 +else if (series === 'week') pull(
3841 File(path.join(__dirname, 'week.jsonp')),
3942 Split(),
4043 pull.filter(Boolean),
4144 pull.map(JSON.parse),
@@ -54,9 +57,9 @@
5457 fs.writeFileSync(path.join(__dirname, 'week.json'), data)
5558 })
5659 )
5760
58-pull(
61 +else if (series === 'month') pull(
5962 File(path.join(__dirname, 'month.jsonp')),
6063 Split(),
6164 pull.filter(Boolean),
6265 pull.map(JSON.parse),

Built with git-ssb-web