npm install slishSlish takes new content of a file as soon as it arrives and is able to distribute it to multiple consumers.
Consumers can be the console or a database, a remote service or simply another file.
Consumer must conform to a simple interface and provide a method consume that takes in the file content that will be provided by Slish. The stage is yours from that point on.
startStreaming on it.consume(newData) where newData is the new file content detected by Slish and you're ready to go.consumers folder contains a separate package.json file to manage the dependencies of the consumers.var slish = new Slish(process.argv[2]);
var consumer = new ColoredWriter();
// The pattern is built in Slish and can be accesed by name
consumer.setActivePattern('Winston');
// Adds the colored to the output channels
slish.addConsumer(consumer);
console.log('start streaming');
// Starts obserrving the file
slish.startStreaming();
~~~