Did-you-mean
did-you-mean
Fuzzy match a command from a list (typo-safety)
This module does a Fuzzy match a word from your list of commands or keywords from node.js/io.js to provide a friendly typo-safe human prompt.
Install it: npm install --save did-you-mean
API:
get -> Get the closest match.
setThreshold(3) -> Set the threshold (the maximum Levenshtein distance)
list('key') -> List all matches.
ignoreCase() -> Set ignore case.
matchCase() -> Set match case.
add('key1','key2',...); -> Add more values.
Usage:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
GIF FTW!
Thanks to Boris Okunskiy for bringing did-you-mean
to web and CLI.