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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sopatizador

v2.0.1

Published

sopa de letras

Readme

Sopatizador 🧩🔍

npm version License GitHub stars

Generador avanzado de sopas de letras en TypeScript para Node.js y navegadores, con soporte para cruce inteligente de palabras.

Características ✨

  • ✅ Generación de sopas de letras con dimensiones personalizables
  • ✅ Colocación inteligente de palabras (horizontal, vertical y diagonal)
  • ✅ Cruce de palabras cuando las letras coinciden
  • ✅ Generación de letras aleatorias para espacios vacíos
  • ✅ Totalmente escrito en TypeScript
  • ✅ Configuración flexible y fácil de usar

Instalación

npm install sopatizador
# o
yarn add sopatizador

Uso básico

import { Sopatizador } from 'sopatizador';

// Crear una sopa de letras 15x15
const sopatizador = new Sopatizador(15, 15);

// Agregar palabras
sopatizador.addWord("JAVASCRIPT");
sopatizador.addWord("TYPESCRIPT");
sopatizador.addWord("NODEJS");

// Obtener la sopa de letras generada
const sopaDeLetras = sopatizador.getAlphabetSoup();

// Imprimir la sopa de letras
sopaDeLetras.forEach(fila => {
  console.log(fila.map(celda => celda.text).join(' '));
});

API

Sopatizador(width: number = 12, height: number = 12)

Constructor que crea una nueva instancia del generador.

addWord(word: string): void

Agrega una palabra a la sopa de letras.

getAlphabetSoup(): Cell[][]

Devuelve la sopa de letras generada como matriz bidimensional.

Tipos

interface Cell {
  text: string;    // Letra de la celda
  decorate: boolean; // Indica si es parte de una palabra
}

interface Position {
  x: number;       // Posición horizontal (columna)
  y: number;       // Posición vertical (fila)
}

Ejemplo avanzado

import { Sopatizador } from 'sopatizador';

// Crear una sopa de letras 20x20
const sopa = new Sopatizador(20, 20);

// Lista de palabras para incluir
const palabrasTecnologia = [
  "JAVASCRIPT",
  "TYPESCRIPT",
  "REACT",
  "ANGULAR",
  "VUE",
  "NODEJS",
  "EXPRESS",
  "MONGODB",
  "WEBSOCKET",
  "GRAPHQL"
];

// Agregar todas las palabras
palabrasTecnologia.forEach(palabra => {
  try {
    sopa.addWord(palabra);
  } catch (error) {
    console.error(`No se pudo agregar: ${palabra}`);
  }
});

// Función para imprimir la sopa de letras
function imprimirSopa(sopa: Cell[][]) {
  console.log('\nSOPA DE LETRAS:\n');
  sopa.forEach(fila => {
    console.log(fila.map(c => c.decorate ? `[${c.text}]` : ` ${c.text} `).join(''));
  });
  console.log('\nPalabras incluidas:', palabrasTecnologia.join(', '));
}

imprimirSopa(sopa.getAlphabetSoup());

Contribuciones 🛠️

Las contribuciones son bienvenidas. Sigue estos pasos:

  1. Haz fork del proyecto
  2. Crea tu branch (git checkout -b feature/nueva-funcionalidad)
  3. Commit tus cambios (git commit -am 'Añade nueva funcionalidad')
  4. Push al branch (git push origin feature/nueva-funcionalidad)
  5. Abre un Pull Request

Licencia 📄

MIT © Armando Rojas

Contacto 📧


✨ ¡Diviértete generando sopas de letras! ✨