a example of extending the event emitter

There are three steps to extending an event emitter.
1.create a class constructor
2.inheriting the event emitter's behavior
3.extending the behavior

example:I create a class called Watcherthat would monitor a directory.If any changes in the directory,Watcherwill rename any files in it to lowercase, and then remove the files into a separate specific directory.

a example of extending the event emitter_第1张图片
WechatIMG75.jpeg

你可能感兴趣的:(a example of extending the event emitter)