compare-words

0.0.1 • Public • Published

Word Match

compare-words is a small utility for assessing how much one word matches another.

It's inspired by https://www.powerlanguage.co.uk/wordle/.

Overview

  • Takes two words of any size
  • The second is compared to the first
  • Compares words for precise and non-precise letter matches
  • Returns an array of tuples revealing the second word letters and their precision against the first

Example

import assess from "compare-words";

assess("begal", "beans");

result

[
  ["b", "correct"],
  ["e", "correct"],
  ["a", "present"],
  ["n", "absent"],
  ["s", "absent"],
];

Resources

Copyright @ Michael Chan Licensed MIT

Readme

Keywords

Package Sidebar

Install

npm i compare-words

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

25.3 kB

Total Files

19

Last publish

Collaborators

  • chantastic