A simple pipe function that runs synchronously and asynchronously Promised based.
I created this module because there were and are still times I would find myself re-creating this function throughout other projects. The main purpose of the function is to pass data from one function/promise to another and then return that data back.
constpipe=require('@andre_garvin/pipe').Promise// If you do not use the `.Promise` property it will still resolve the Promise being pased to pipefunctionstripChar(str,sep){returnnewPromise(resolve=>{consttransformedStr=str.split('').reduce((newTransformedStr,char)=>{if(!sep.includes(char.toLowerCase())){newTransformedStr+=char;returnnewTransformedStr;}returnnewTransformedStr},'')returnresolve(transformedStr)})}// you can also pass in other arguments into the functionpipe([reverse,upperCase,stripChar],'Hello, World!','l').then(newStr=>console.log(newStr))// !DROW ,OEH