npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cm-ayf/wordle-solver

v0.2.0

Published

wordle solver.

Downloads

3

Readme

wordle-solver

wordle solver.

npm package (via wasm): @cm-ayf/wordle-solver

status (hint) format

five-chars &str (string in JS/TS) of:

  • G (g): Green color (match on exact position)
  • Y (y): Yellow color (match on other position)
  • _ ( ): Gray color (no match)

install

  • Rust

add following to Cargo.toml, below [dependencies]:

wordle-solver = { git = "https://github.com/cm-ayf/wordle-solver" }
  • JS / TS
npm i @cm-ayf/wordle-solver

usage

Rust

  • CLI
$ cargo run --release # significantly faster with --release
AIERY
__YY_ # input
WEROS
_GY__ # input
TURFY
YYY__ # input
ZYMIC
_____ # input
REBUT
  • library crate
let mut solver = Solver::new();

assert!(!solver.finished());
assert_eq!(solver.answer(), None);
let word = solver.start();
assert_eq!(&word, "AIERY");
let word = solver.next("__YY_")?;
assert_eq!(&word, "WEROS");
let word = solver.next("_GY__")?;
assert_eq!(&word, "TURFY");
let word = solver.next("YYY__")?;
assert_eq!(&word, "ZYMIC");
let word = solver.next("_____")?;
assert_eq!(&word, "REBUT");

assert!(solver.finished());
assert_eq!(solver.answer(), Some("REBUT".to_string()));

TypeScript / JavaScript

import { Solver } from 'wordle-solver';
// const { Solver } = require('wordle-solver'); // JavaScript

const solver = new Solver();
console.log(solver.finished()); // false
console.log(solver.answer()); // undefined

let word = solver.start();
console.log(word); // AIERY
word = solver.next('__YY_');
console.log(word); // WEROS
word = solver.next('_GY__');
console.log(word); // TURFY
word = solver.next('YYY__');
console.log(word); // ZYMIC
word = solver.next('_____');
console.log(word); // REBUT

console.log(solver.finished()); // true
console.log(solver.answer()); // REBUT

reference

struct (class) Solver

  • Solver::new (constructor)
    • strict: set true to use in hard mode.
  • Solver(.prototype).start
    • start solving.
    • returns first query.
    • might take a few seconds.
  • Solver(.prototype).next
    • status: &str / string: text describing the hint from last query.
    • returns next query.
    • might take a few sub second.
  • Solver(.prototype).finished
    • returns boolean; if solver has the answer, true.
  • Solver(.prototype).answer
    • returns answer if solver has it.