Example of how a pipeline architecture in JavaScript