{"id":25120121,"url":"https://github.com/yo35/kokopu","last_synced_at":"2025-05-07T10:42:49.367Z","repository":{"id":38361659,"uuid":"132338227","full_name":"yo35/kokopu","owner":"yo35","description":"A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.","archived":false,"fork":false,"pushed_at":"2025-04-07T18:55:06.000Z","size":2522,"stargazers_count":29,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T18:55:15.920Z","etag":null,"topics":["chess","fen","javascript","pgn","typescript","uci"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/kokopu","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yo35.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-06T12:54:05.000Z","updated_at":"2025-04-06T12:48:31.000Z","dependencies_parsed_at":"2023-02-18T09:16:11.145Z","dependency_job_id":"87eced9a-d72d-4c41-8ae2-5f38cc0e045a","html_url":"https://github.com/yo35/kokopu","commit_stats":{"total_commits":654,"total_committers":4,"mean_commits":163.5,"dds":"0.022935779816513735","last_synced_commit":"7e87e4466d4388e028610aae7f1207469439ac37"},"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yo35%2Fkokopu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yo35%2Fkokopu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yo35%2Fkokopu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yo35%2Fkokopu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yo35","download_url":"https://codeload.github.com/yo35/kokopu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252862183,"owners_count":21815811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","fen","javascript","pgn","typescript","uci"],"created_at":"2025-02-08T05:19:17.507Z","updated_at":"2025-05-07T10:42:49.358Z","avatar_url":"https://github.com/yo35.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kokopu\n======\n\n\u003cimg align=\"right\" width=\"96\" height=\"96\" src=\"graphics/logo.svg\" /\u003e\n\nKokopu is a JavaScript/TypeScript chess library.\nIt implements the chess game rules, and provides tools to read/write the standard chess file formats\n([PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation),\n[FEN](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation),\n[UCI](https://en.wikipedia.org/wiki/Universal_Chess_Interface),\netc.).\n\nhttps://www.npmjs.com/package/kokopu\n\n[![Build Status](https://github.com/yo35/kokopu/actions/workflows/main.yml/badge.svg)](https://github.com/yo35/kokopu/actions/workflows/main.yml)\n[![Coverage Status](https://coveralls.io/repos/github/yo35/kokopu/badge.svg?branch=master)](https://coveralls.io/github/yo35/kokopu?branch=master)\n\n\n\nDownload\n--------\n\nhttps://kokopu.yo35.org/dist/kokopu.zip\n\n\n\nDocumentation\n-------------\n\nhttps://kokopu.yo35.org/\n\n\n\nMigrate to 3.x and 4.x\n----------------------\n\nVersions 3.0.0 and 4.0.0 introduce some breaking changes with regard to the previous versions.\nTo determine whether your codebase needs to be adapted or not when upgrading Kokopu,\nplease look at:\n- [Migrate to 4.x](https://kokopu.yo35.org/docs/current/pages/migrate_to_4.html) to upgrade from 3.x to 4.0.0 (or any subsequent version).\n- [Migrate to 3.x](https://kokopu.yo35.org/docs/current/pages/migrate_to_3.html) and\n[Migrate to 4.x](https://kokopu.yo35.org/docs/current/pages/migrate_to_4.html) to upgrade from 1.x or 2.x to 4.0.0 (or any subsequent version).\n\n\n\nFeatures\n--------\n\n* Chess move generation.\n* Check, checkmate and stalemate detection.\n* Move legality check.\n* [Algrebraic notation](https://en.wikipedia.org/wiki/Algebraic_notation_(chess)) parsing and generation.\n* [FEN notation](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) parsing and generation.\n* [UCI move](https://en.wikipedia.org/wiki/Universal_Chess_Interface) parsing and generation.\n* [PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation) file parsing and generation (including advanced PGN features\nsuch as commentaries, sub-variations, [NAGs](https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs),\nnon-standard starting position...).\n* Support several chess variants:\n  - [Chess960](https://en.wikipedia.org/wiki/Chess960), also known as Fischer Random Chess.\n  - [Antichess](https://en.wikipedia.org/wiki/Losing_chess), also known as losing chess, giveaway chess, suicide chess...\n  - [Horde chess](https://en.wikipedia.org/wiki/Dunsany%27s_chess#Horde_chess) (following Lichess/Chess.com rules).\n\nKokopu is a headless library, meaning it does not provide any user interface.\nIf you are interested in UI features (e.g. to be able to render a chessboard component within a web page),\nyou may take a look at [Kokopu-React](https://www.npmjs.com/package/kokopu-react), which is a [React](https://reactjs.org/)-based library\nbuilt on top of Kokopu to provide these kind of features.\n\n\n\nExample\n-------\n\n```javascript\nconst { Position } = require('kokopu');\n\n// Create a new position, play some moves...\nconst position = new Position();\nposition.play('e4');\nposition.play('e5');\nposition.play('Nf3');\n\n// Display an ASCII-art representation of the position.\nconsole.log(position.ascii({ coordinateVisible: true }));\n\n//   +---+---+---+---+---+---+---+---+\n// 8 | r | n | b | q | k | b | n | r |\n//   +---+---+---+---+---+---+---+---+\n// 7 | p | p | p | p |   | p | p | p |\n//   +---+---+---+---+---+---+---+---+\n// 6 |   |   |   |   |   |   |   |   |\n//   +---+---+---+---+---+---+---+---+\n// 5 |   |   |   |   | p |   |   |   |\n//   +---+---+---+---+---+---+---+---+\n// 4 |   |   |   |   | P |   |   |   |\n//   +---+---+---+---+---+---+---+---+\n// 3 |   |   |   |   |   | N |   |   |\n//   +---+---+---+---+---+---+---+---+\n// 2 | P | P | P | P |   | P | P | P |\n//   +---+---+---+---+---+---+---+---+\n// 1 | R | N | B | Q | K | B |   | R |\n//   +---+---+---+---+---+---+---+---+\n//     a   b   c   d   e   f   g   h\n// b KQkq -\n\n// List the available moves.\nconst moves = position.moves();\nconsole.log(moves.map(move =\u003e position.notation(move)));\n\n// [ 'a6', 'a5', 'b6', 'b5', 'c6', 'c5', 'd6','d5', 'f6', 'f5', 'g6',\n// 'g5', 'h6', 'h5', 'Na6', 'Nc6', 'Qe7', 'Qf6', 'Qg5', 'Qh4', 'Ke7',\n// 'Be7', 'Bd6', 'Bc5', 'Bb4', 'Ba3', 'Nf6', 'Nh6', 'Ne7' ]\n```\n\nMore examples available in [documentation](https://kokopu.yo35.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyo35%2Fkokopu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyo35%2Fkokopu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyo35%2Fkokopu/lists"}