- 3.1 A simple event: Modify the asynchronous
FindRegexclass so that it emits an event when the find process starts, passing the input files list as an argument. Hint: beware of Zalgo!
- 3.2 Ticker: Write a function that accepts a
callbackas the arguments. The function will return an
EventEmitterthat emits an event called
tickevery 50 milliseconds until the
numberof milliseconds is passed from the invocation of the function. The function will also call the
numberof milliseconds has passed, providing, as the result, the total count of
tickevents emitted. Hint: you can use
setTimeout()to schedule another
- 3.3 A simple modification: Modify the function created in exercise 3.2 so that it emits a
tickevent immediately after the function is invoked.
- 3.4 Playing with errors: Modify the function created in exercise 3.3 so that it produces an error if the timestamp at the moment of a