{"_id":"@aydee-app/word-search","_rev":"5-53b75b529c3f8726d2406615f45696e8","name":"@aydee-app/word-search","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"@aydee-app/word-search","version":"0.0.1","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","_id":"@aydee-app/word-search@0.0.1","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"homepage":"https://github.com/aydee-app/word-search#readme","bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"dist":{"shasum":"2ffc710614a30540bd5f880bcf978e9be8f6c910","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.0.1.tgz","fileCount":5,"integrity":"sha512-thJ09xUr5XnYcioUwEc1MD2Hop3WPzf41qydyTx4NTv3vis36AMOrBVs4OgO86UPJDCheA7reTSCdqzaORgcNQ==","signatures":[{"sig":"MEQCIBsswDBwLfmQQCcmpAk4D7kMqL/eGGZ0atQ2/WJgc5TsAiAPkBxeMbfaW/sAQazFx6RLWjVOealFq9pO2vYspyduRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11990},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"gitHead":"21512b3a7d56c72ce18f86ae4e59dfe3e39ace34","scripts":{"test":"bun test --rerun-each 777","build":"bun run build.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"repository":{"url":"git+https://github.com/aydee-app/word-search.git","type":"git"},"_npmVersion":"10.1.0","description":"Word search generator with customizable grid sizes and word placements.","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.10","bun-plugin-dts":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/word-search_0.0.1_1737323756371_0.10885577060608664","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@aydee-app/word-search","version":"0.0.2","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","_id":"@aydee-app/word-search@0.0.2","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"homepage":"https://github.com/aydee-app/word-search#readme","bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"dist":{"shasum":"31cd43b296be39449055bb80e10e42a940f8606c","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.0.2.tgz","fileCount":5,"integrity":"sha512-ym4I86IRAkqJR8qT0gEBwojwH3DrVEP6eNRTbA70mQFESCSbWbon6ldAtyvjwzyyoa7s2R/6KIOrzm0AYIHMsw==","signatures":[{"sig":"MEUCIQC6f2JvH50lYbXjUf3g3laP/eXsEtjwdZezTwD9baNT7AIgEFe7A9YwjqL1liKEVLjQbtsGy+Io6IZ72r6DCS4JCT0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12010},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"gitHead":"59f72c42d98a27291d8077bb7e0e149baa1c7c9c","scripts":{"test":"bun test --rerun-each 777","build":"bun run build.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"repository":{"url":"git+https://github.com/aydee-app/word-search.git","type":"git"},"_npmVersion":"10.1.0","description":"Word search generator with customizable grid sizes and word placements.","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.10","bun-plugin-dts":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/word-search_0.0.2_1737324823812_0.9389038984801548","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@aydee-app/word-search","version":"0.0.6","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","_id":"@aydee-app/word-search@0.0.6","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"homepage":"https://github.com/aydee-app/word-search#readme","bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"dist":{"shasum":"d71dfe20054cf8327f3702a781b6bd1d74965436","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.0.6.tgz","fileCount":5,"integrity":"sha512-QBtRNPgfMlLvlSARBe63SBsIjfcuJwy9b+qeQKoRTaXSiatZ9UBRYrJ+UM1fmgHqa5meHFgV/gZQHoMsk7Qi4g==","signatures":[{"sig":"MEQCIG0spJjSwzthGKQxlrvOTS4tKKHEbsnrlr3ugy1qYD1eAiBNA7EsfSCjyvFznaQ2WBva0pbbh9IGcbvCc2UO/1kh6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12426},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"gitHead":"777d225203e26141040933e56f81dfd8c1475c30","scripts":{"test":"bun test --rerun-each 777","build":"bun run build.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"repository":{"url":"git+https://github.com/aydee-app/word-search.git","type":"git"},"_npmVersion":"10.1.0","description":"Word search generator with customizable grid sizes and word placements.","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.10","bun-plugin-dts":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/word-search_0.0.6_1737328073843_0.4472774436201028","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@aydee-app/word-search","version":"0.0.7","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","_id":"@aydee-app/word-search@0.0.7","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"homepage":"https://github.com/aydee-app/word-search#readme","bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"dist":{"shasum":"c9a221ac96f450b4311415b7c3d8cb811a8d6290","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.0.7.tgz","fileCount":5,"integrity":"sha512-2nOzvsJlp7t64n6sXHWcOoWgu0/myaFpHSI2QXYmFnec8z0anYJrTbDG+LOpZSlKy4Q/K1P0PtW8QZPmPVheEw==","signatures":[{"sig":"MEUCIF4vTJ4PZsTUjRqlnfgIn8zU9Cx5MjLJaTs2VpdorldVAiEAxiOO0wL3fyylGBXyqElNw3Xlyn7GE+c1RIx+nJRertY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13291},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"gitHead":"02a11be6f287fcc10527d4639d2ffcea6be7146b","scripts":{"test":"bun test --rerun-each 777","build":"bun run build.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"repository":{"url":"git+https://github.com/aydee-app/word-search.git","type":"git"},"_npmVersion":"10.1.0","description":"Word search generator with customizable grid sizes and word placements.","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.10","bun-plugin-dts":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/word-search_0.0.7_1737368014250_0.724421524862382","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"@aydee-app/word-search","version":"0.0.9","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","_id":"@aydee-app/word-search@0.0.9","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"homepage":"https://github.com/aydee-app/word-search#readme","bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"dist":{"shasum":"57a37b9124957272b720a6da41f7891454896056","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.0.9.tgz","fileCount":5,"integrity":"sha512-unuHVmjpvEynW4baObofIAOHImhVShaLtLAZT998UtoC0lfbm4/wYMNhXyNopU7J3Mt1aUeGnplANQ+RcFFO5g==","signatures":[{"sig":"MEUCIFxUOqqO6+S5TwvR9LThmPNaeKcI8XbP0sG7nhw4v2wTAiEApvt+v+mC34qArx4SVdpqLEK56MK7kyOLg0Uo6u2MB4Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aydee-app%2fword-search@0.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14446},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"gitHead":"7c30e6c1eff1ce1c833020d967541cca2b3ac79a","scripts":{"test":"bun test --rerun-each 777","build":"bun run build.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"repository":{"url":"git+https://github.com/aydee-app/word-search.git","type":"git"},"_npmVersion":"10.8.2","description":"Word search generator with customizable grid sizes and word placements.","directories":{},"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.10","bun-plugin-dts":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/word-search_0.0.9_1737371275629_0.9514504314847554","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aydee-app/word-search","type":"module","version":"0.1.1","module":"./dist/index.js","types":"./dist/index.d.ts","description":"Word search generator with customizable grid sizes and word placements.","exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"scripts":{"build":"bun run build.ts","prepublishOnly":"bun run build","test":"bun test --rerun-each 777"},"keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"license":"MIT","homepage":"https://github.com/aydee-app/word-search#readme","repository":{"type":"git","url":"git+https://github.com/aydee-app/word-search.git"},"bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"devDependencies":{"bun-plugin-dts":"^0.3.0","@types/bun":"^1.1.10"},"_id":"@aydee-app/word-search@0.1.1","gitHead":"1a54945481d3eefad627c881cba442c64f653f26","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Q9MBSob8cs6hypIZd6xF9qZZ7w79HUB6PFUai2+RYrGSmaDiM1bj+W1CQXhlanWkaS0athvVlcN8mjNc8aZHiA==","shasum":"0daa83dd3764845e544e42e40e024827c663ec8d","tarball":"https://registry.npmjs.org/@aydee-app/word-search/-/word-search-0.1.1.tgz","fileCount":5,"unpackedSize":14580,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aydee-app%2fword-search@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVDcA5PjcwgssSjpG2oSTXTSYkPCcsPUZLiZui+TqhiQIgeg6G1qqgeb2EgKOjN6CEyhbs19FX0uBqhhP+X7rKZrI="}]},"_npmUser":{"name":"yassinrais","email":"yassmailrais@gmail.com"},"directories":{},"maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/word-search_0.1.1_1737377748999_0.6639539785814237"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-19T21:55:56.265Z","modified":"2025-01-20T12:55:49.617Z","0.0.1":"2025-01-19T21:55:56.558Z","0.0.2":"2025-01-19T22:13:44.029Z","0.0.6":"2025-01-19T23:07:54.024Z","0.0.7":"2025-01-20T10:13:34.422Z","0.0.9":"2025-01-20T11:07:55.812Z","0.1.1":"2025-01-20T12:55:49.212Z"},"bugs":{"url":"https://github.com/aydee-app/word-search/issues"},"author":{"name":"Yassine Rais","email":"yassine@rais.me"},"license":"MIT","homepage":"https://github.com/aydee-app/word-search#readme","keywords":["bun","word-search","word-search-puzzle","word-grid","word-grid-puzzle","puzzle-generator","typescript"],"repository":{"type":"git","url":"git+https://github.com/aydee-app/word-search.git"},"description":"Word search generator with customizable grid sizes and word placements.","maintainers":[{"name":"yassinrais","email":"yassmailrais@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://github.com/aydee-app/word-search\">\n   <img src=\"https://github.com/user-attachments/assets/3e6c0717-da39-40d6-b1f0-c8bcde3c4126\" alt=\"Logo\">\n  </a>\n\n  <h2 align=\"center\">Word Search</h2>\n\n  <p align=\"center\">\n    A highly customizable word search puzzle generator that allows dynamic grid sizing, optimized word placements, and more.\n    <br />\n    <a href=\"https://aydee.app\">Aydee</a>\n  </p>\n</p>\n\n\n## Features\n\n- Customizable grid size\n- Dynamic word placement strategy\n- Supports horizontal, vertical, and diagonal directions\n- Fills blank spaces with random letters\n- Handles large word lists efficiently\n- Import/Export Grid\n\n## Installation\n\nYou can install `@aydee-app/word-search` via `bun`:\n\n```bash\nbun add @aydee-app/word-search\n```\n\nAlternatively, use npm or yarn:\n\n```bash\nnpm install @aydee-app/word-search\n# or\nyarn add @aydee-app/word-search\n```\n\n## Usage\n\n### Basic Example\n\n```ts\nimport { WordSearch } from '@aydee-app/word-search';\n\nconst wordSearch = new WordSearch({\n  words: ['apple', 'banana', 'cherry', 'date'],\n  size: 10,\n  allowDiagonal: true,\n  fillBlanks: true,\n});\n\nconst grid = wordSearch.generate();\nconsole.log(wordSearch.toString());\n```\n\n### Customizing the Grid Size\n\nYou can let the generator calculate the optimal grid size based on the words' total length or specify it manually:\n\n```ts\nconst wordSearch = new WordSearch({\n  words: ['apple', 'banana', 'cherry'],\n  size: 15,  // Manually set grid size\n  allowDiagonal: false,\n  fillBlanks: false,\n});\n\nconst grid = wordSearch.generate();\nconsole.log(wordSearch.toString());\n```\n\n## API\n\n### `WordSearch(options: WordSearchOptions)`\n\nConstructor to initialize a WordSearch puzzle generator.\n\n#### Parameters\n\n- `words` (string[]): An array of words to include in the puzzle.\n- `size` (number, optional): The grid size. If not specified, it will be calculated based on the word lengths.\n- `allowDiagonal` (boolean, optional): Specifies whether diagonal word placement is allowed. Default is `false`.\n- `fillBlanks` (boolean, optional): Specifies whether to fill empty spaces with random letters. Default is `true`.\n\n#### Methods\n\n- **`generate(): string[][]`**  \n  Generates the word search puzzle and returns a 2D array representing the grid.\n\n- **`hasWord(word: string): boolean`**  \n  Checks if a word exists in the puzzle.\n\n- **`getPositions(word: string): Position[] | null`**  \n  Returns the positions of a word in the puzzle, or `null` if the word is not found.\n\n- **`getGrid(): string[][]`**  \n  Returns the current state of the grid.\n\n- **`getGridSize(): number`**  \n  Returns the current size of the grid.\n\n- **`export(): { grid: string[][], positions: Map<string, Position[]>, size: number }`**  \n  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.\n\n- **`import(data: {grid: string[][], positions: Map<string, Position[]}>): void`**  \n  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.\n\n- **`print(): void`**  \n  Prints the current grid to the console.\n\n- **`toString(): string`**  \n  Converts the grid into a string format for easier display.\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nFeel free to fork the repository and submit pull requests. We welcome contributions!","readmeFilename":"README.md"}