Matt Low
7ac3e6ad06
Moves sudoku generation off of the main thread. Allows for multiple generation requests (up to the number of physical CPU cores) to be served in parallel. Uses the "physical-cpu-count" node package to determine the numer of physical CPUs of the host. Also introduces a timeout which causes too-difficult (or impossible) generation requests to fail if they take more than 5 seconds to complete. In effect soft-capping the complexity of generated puzzles.
47 lines
1.2 KiB
JSON
47 lines
1.2 KiB
JSON
{
|
|
"name": "sudoku-api",
|
|
"version": "0.1.0",
|
|
"description": "Sudoku generating and solving API",
|
|
"main": "dist/main.js",
|
|
"dependencies": {
|
|
"@graphql-tools/merge": "^6.2.9",
|
|
"@graphql-tools/schema": "^6.2.4",
|
|
"dotenv": "^8.2.0",
|
|
"graphql": "^15.5.0",
|
|
"graphql-tag": "^2.11.0",
|
|
"graphql-type-json": "^0.3.2",
|
|
"koa": "^2.13.1",
|
|
"koa-bodyparser": "^4.3.0",
|
|
"koa-router": "^9.4.0",
|
|
"node-worker-threads-pool": "^1.4.3",
|
|
"physical-cpu-count": "^2.0.0",
|
|
"stoppable": "^1.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/koa": "^2.13.0",
|
|
"@types/koa-bodyparser": "^4.3.0",
|
|
"@types/koa-router": "^7.4.1",
|
|
"@types/markdown-it": "^10.0.3",
|
|
"@types/physical-cpu-count": "^2.0.0",
|
|
"@types/stoppable": "^1.1.0",
|
|
"nodemon": "^2.0.7",
|
|
"ts-node": "^8.10.2",
|
|
"typescript": "^3.9.9"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc -p tsconfig.json",
|
|
"start": "node -r dotenv/config -r ts-node/register src/main.ts",
|
|
"serve": "nodemon"
|
|
},
|
|
"nodemonConfig": {
|
|
"watch": [
|
|
"src"
|
|
],
|
|
"exec": "npm start",
|
|
"ext": "ts"
|
|
},
|
|
"author": "Matt Low <matt@mlow.ca>",
|
|
"license": "UNLICENSED",
|
|
"private": true
|
|
}
|