Browse Source

Got the two starters down.

master
Zed A. Shaw 4 weeks ago
parent
commit
34b089b19a
  1. 5
      02-filter-a-log-file/step1.js
  2. 8
      02-filter-a-log-file/step2.js

5
02-filter-a-log-file/step1.js

@ -4,4 +4,7 @@ const raw_log = fs.readFileSync(process.argv[2]);
const lines = raw_log.toString().split("\n");
console.log(lines);
const search = new RegExp(process.argv[3]);
// continue here, how do you find all the lines matching the regex?
// how complex can you make this? Is it necessary?

8
02-filter-a-log-file/step2.js

@ -0,0 +1,8 @@
import fs from "fs";
const raw_log = fs.readFileSync(process.argv[2]);
const lines = raw_log.toString().split("\n");
// now you have to figure out how to split each line of the
// web log into something meaningful
Loading…
Cancel
Save