find Most Similar
Use Levenshtein distance alg to find the most similar word in an array. Perfect for providing suggestions in error messages and/or recovering from spelling mistakes.
Install
Install via npm
npm install --save find-most-similar
How to use
; // the word you are checking others againstconst source = 'book'; // words to search for the closest to the source wordconst words = 'lock''block' 'back' 'hack'; // returns the word that requires the fewest changes to convert to the source word; // returns 'back'