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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aydee-app/word-search

v0.1.1

Published

Word search generator with customizable grid sizes and word placements.

Downloads

11

Readme

Features

  • Customizable grid size
  • Dynamic word placement strategy
  • Supports horizontal, vertical, and diagonal directions
  • Fills blank spaces with random letters
  • Handles large word lists efficiently
  • Import/Export Grid

Installation

You can install @aydee-app/word-search via bun:

bun add @aydee-app/word-search

Alternatively, use npm or yarn:

npm install @aydee-app/word-search
# or
yarn add @aydee-app/word-search

Usage

Basic Example

import { WordSearch } from '@aydee-app/word-search';

const wordSearch = new WordSearch({
  words: ['apple', 'banana', 'cherry', 'date'],
  size: 10,
  allowDiagonal: true,
  fillBlanks: true,
});

const grid = wordSearch.generate();
console.log(wordSearch.toString());

Customizing the Grid Size

You can let the generator calculate the optimal grid size based on the words' total length or specify it manually:

const wordSearch = new WordSearch({
  words: ['apple', 'banana', 'cherry'],
  size: 15,  // Manually set grid size
  allowDiagonal: false,
  fillBlanks: false,
});

const grid = wordSearch.generate();
console.log(wordSearch.toString());

API

WordSearch(options: WordSearchOptions)

Constructor to initialize a WordSearch puzzle generator.

Parameters

  • words (string[]): An array of words to include in the puzzle.
  • size (number, optional): The grid size. If not specified, it will be calculated based on the word lengths.
  • allowDiagonal (boolean, optional): Specifies whether diagonal word placement is allowed. Default is false.
  • fillBlanks (boolean, optional): Specifies whether to fill empty spaces with random letters. Default is true.

Methods

  • generate(): string[][]
    Generates the word search puzzle and returns a 2D array representing the grid.

  • hasWord(word: string): boolean
    Checks if a word exists in the puzzle.

  • getPositions(word: string): Position[] | null
    Returns the positions of a word in the puzzle, or null if the word is not found.

  • getGrid(): string[][]
    Returns the current state of the grid.

  • getGridSize(): number
    Returns the current size of the grid.

  • export(): { grid: string[][], positions: Map<string, Position[]>, size: number }
    Exports a deep copy of the current grid along with the positions of all placed words in the puzzle. The return value is an object containing the grid and placed words.

  • import(data: {grid: string[][], positions: Map<string, Position[]}>): void
    Imports a grid and the associated placed words into the puzzle. This method allows you to restore a previous state of the grid, including the positions of the words. If the imported grid dimensions or word placements are invalid, an error will be thrown.

  • print(): void
    Prints the current grid to the console.

  • toString(): string
    Converts the grid into a string format for easier display.


License

MIT License. See LICENSE for details.

Contributing

Feel free to fork the repository and submit pull requests. We welcome contributions!