Edit distance and alignment in Node.js