{"_id":"@edracoon/sudoku-solver-wasm","_rev":"3-ffa5e088753ff619da15aae0791a0e22","name":"@edracoon/sudoku-solver-wasm","dist-tags":{"latest":"1.6.2"},"versions":{"1.4.0":{"name":"@edracoon/sudoku-solver-wasm","version":"1.4.0","_id":"@edracoon/sudoku-solver-wasm@1.4.0","maintainers":[{"name":"edracoon","email":"edgar.pfennig@gmail.com"}],"dist":{"shasum":"7a7f19419a398e6e27698b51180677215ea1eee0","tarball":"https://registry.npmjs.org/@edracoon/sudoku-solver-wasm/-/sudoku-solver-wasm-1.4.0.tgz","fileCount":7,"integrity":"sha512-yQyg+6C0I//cLfTWfxSxHUHMtkLG96uVbf2sp5Lr1UeDrPDDsINhYmTTFFoDWUXy1rdI9adzg4uW06BdbagNjQ==","signatures":[{"sig":"MEUCIEMiJKYY47EYSz+XBXlccy+AvxxCjItmpqVIk7cKYixeAiEA6aARC8dhk1QgFZVMrSe9RRjlDg0OvfgwLChtlNARoLs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18500},"main":"module/index.js","type":"module","types":"module/index.d.ts","gitHead":"f5dd32004c2984d7502486a5fcefebe2076745fc","scripts":{"build":"make wasm","tests":"node tests/test.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"edracoon","email":"edgar.pfennig@gmail.com"},"_npmVersion":"11.7.0","description":"A fast Sudoku solver compiled to WebAssembly from C.","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sudoku-solver-wasm_1.4.0_1773491139992_0.6151684959085524","host":"s3://npm-registry-packages-npm-production"}},"1.6.1":{"name":"@edracoon/sudoku-solver-wasm","version":"1.6.1","_id":"@edracoon/sudoku-solver-wasm@1.6.1","maintainers":[{"name":"edracoon","email":"edgar.pfennig@gmail.com"}],"homepage":"https://github.com/Edracoon/sudoku-solver-wasm#readme","bugs":{"url":"https://github.com/Edracoon/sudoku-solver-wasm/issues"},"dist":{"shasum":"b169e322c7c9330e8adc6cd4d1168a5ff916b02d","tarball":"https://registry.npmjs.org/@edracoon/sudoku-solver-wasm/-/sudoku-solver-wasm-1.6.1.tgz","fileCount":7,"integrity":"sha512-+7BAg4TZ3XGWhhtHAzfpW1NJoGzW08+nErSO7Ix6Xghx6b8SLznXRc7WPg8kT04JBf+a0CJ9pZ0EAHKG1+xybg==","signatures":[{"sig":"MEUCIEpzOJYPyhiC7GLQRkxD9aaMuEwE00sNd7gGu1ieJhzqAiEAktdUd3ENtibzUH07+l/56jd70iteLqf4QwGacLvt9dA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@edracoon%2fsudoku-solver-wasm@1.6.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":18634},"main":"module/index.js","type":"module","types":"module/index.d.ts","gitHead":"18898b573f3aa0f75656187bbefe99f8501d8e70","scripts":{"build":"make wasm","tests":"node tests/test.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ad656d4b-5476-4366-8bac-ef5ece53671b"}},"repository":{"url":"git+https://github.com/Edracoon/sudoku-solver-wasm.git","type":"git"},"_npmVersion":"11.9.0","description":"A fast Sudoku solver compiled to WebAssembly from C.","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sudoku-solver-wasm_1.6.1_1773492372713_0.8872774038923761","host":"s3://npm-registry-packages-npm-production"}},"1.6.2":{"name":"@edracoon/sudoku-solver-wasm","version":"1.6.2","repository":{"type":"git","url":"git+https://github.com/Edracoon/sudoku-solver-wasm.git"},"type":"module","main":"module/index.js","types":"module/index.d.ts","scripts":{"build":"make wasm","tests":"node tests/test.js","prepublishOnly":"npm run build"},"devDependencies":{"typescript":"^5.0.0"},"gitHead":"25064ff1ad3ad56d061291f479a141f028493ef4","_id":"@edracoon/sudoku-solver-wasm@1.6.2","description":"A fast Sudoku solver compiled to WebAssembly from C.","bugs":{"url":"https://github.com/Edracoon/sudoku-solver-wasm/issues"},"homepage":"https://github.com/Edracoon/sudoku-solver-wasm#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-OxW8CGQb6gUXlQNEjMnyLIHcFilunWAXOJLt8NXqJlQ3Q+Q8HwUQMoigQhwmV+33CjXRBEniYWAVJFwruYFfEg==","shasum":"bd93f8f523d892d97b100944b3c8fa378193120d","tarball":"https://registry.npmjs.org/@edracoon/sudoku-solver-wasm/-/sudoku-solver-wasm-1.6.2.tgz","fileCount":7,"unpackedSize":18634,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@edracoon%2fsudoku-solver-wasm@1.6.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCs4U7bPe5Q+yECRRiR8r1tL5PUB8hDl5RT2PVSltJpjAIgH0osKSyJg9GFVa3NxpKObNViSZPGj/3arJY2l1d1+18="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ad656d4b-5476-4366-8bac-ef5ece53671b"}},"directories":{},"maintainers":[{"name":"edracoon","email":"edgar.pfennig@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sudoku-solver-wasm_1.6.2_1773492887684_0.013378851968722794"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-14T12:25:39.890Z","modified":"2026-03-14T12:54:48.096Z","1.4.0":"2026-03-14T12:25:40.162Z","1.6.1":"2026-03-14T12:46:12.864Z","1.6.2":"2026-03-14T12:54:47.825Z"},"bugs":{"url":"https://github.com/Edracoon/sudoku-solver-wasm/issues"},"homepage":"https://github.com/Edracoon/sudoku-solver-wasm#readme","repository":{"type":"git","url":"git+https://github.com/Edracoon/sudoku-solver-wasm.git"},"description":"A fast Sudoku solver compiled to WebAssembly from C.","maintainers":[{"name":"edracoon","email":"edgar.pfennig@gmail.com"}],"readme":"# sudoku-solver-wasm\n\nA fast Sudoku solver compiled to WebAssembly from C.\n\nThe solving logic is written in C using a **backtracking algorithm** and compiled to WASM via [Emscripten](https://emscripten.org/). The JS layer is a thin wrapper that handles input/output conversion — no runtime dependencies.\n\n## Install\n\n```sh\nnpm install @edracoon/sudoku-solver-wasm\n```\n\n## Usage\n\n```js\nimport { solve } from '@edracoon/sudoku-solver-wasm';\n```\n\n`solve(grid)` accepts either a **2D array** or a **flat 81-character string** and always returns a `number[][]`, or `null` if the puzzle has no solution or the input is invalid (wrong length, invalid characters).\n\n```js\n// 2D array input\nconst solved = solve([\n    [0, 1, 0, 0, 0, 0, 0, 6, 9],\n    [4, 0, 6, 0, 0, 0, 0, 7, 5],\n    [7, 0, 0, 0, 0, 0, 0, 0, 0],\n    [0, 0, 0, 0, 7, 0, 4, 0, 0],\n    [1, 0, 0, 0, 2, 0, 0, 0, 0],\n    [3, 0, 0, 5, 0, 1, 9, 0, 0],\n    [0, 2, 7, 0, 0, 3, 0, 0, 0],\n    [0, 0, 0, 9, 0, 0, 0, 0, 7],\n    [0, 0, 9, 0, 0, 0, 8, 0, 0]\n]);\n\n// Flat string input\nconst solved = solve('687004910913000000254700000045090001006105040000000200400560030002473090508921704');\n```\n\nOr use `solveFlat()` with the same inputs if you need the result as a flat string instead of a 2D array.\n\n## How it works\n\nThe solver is written in C and uses a classic **backtracking algorithm**:\n\n1. Find the first empty cell (`0`)\n2. Try each digit `1–9`, checking row, column, and 3×3 box constraints\n3. Recurse — if no digit fits, backtrack and try the next one\n\n## Build from source\n\nRequires [emsdk](https://emscripten.org/docs/getting_started/downloads.html) and Node.js 22+.\n\n```sh\nnpm install\nnpm run build\n```\n","readmeFilename":"README.md"}