{"_id":"chess-tcn","_rev":"1329208-61c73a4c5c7ca78c0c9e5517","dist-tags":{"latest":"1.1.1"},"name":"chess-tcn","time":{"created":"2021-12-25T15:35:40.963Z","modified":"2025-07-18T03:03:44.546Z","0.1.0":"2025-07-04T01:01:31.462Z","1.1.0":"2025-07-04T01:13:25.637Z","1.1.1":"2025-07-18T03:03:41.463Z"},"versions":{"0.1.0":{"name":"chess-tcn","version":"0.1.0","description":"Encode and decode TCN, a move format used by Chess.com's API","main":"src/index.js","types":"src/index.d.ts","type":"module","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js"},"repository":{"type":"git","url":"git+https://github.com/chess-tcn/chess-tcn-js.git"},"keywords":["chess"],"author":{"name":"chess-tcn"},"license":"MIT","bugs":{"url":"https://github.com/chess-tcn/chess-tcn-js/issues"},"homepage":"https://github.com/chess-tcn/chess-tcn-js#readme","jest":{"roots":["<rootDir>/tests"],"testMatch":["**/tests/**/*.test.js"]},"dependencies":{"chess.js":"^1.4.0"},"devDependencies":{"@types/jest":"^30.0.0","eslint":"^9.30.1","jest":"^30.0.4"},"_id":"chess-tcn@0.1.0","_nodeVersion":"22.16.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-sE0P4jnLeWL6Vp9w9t457wYCs8ORR+Boip5jjS9yvVt3oTXVN4jGH2g4yPE/mHzMorERfiVQHu7OPsMIIVi1Jg==","shasum":"d27f7029a77880fd85440284d385f0e743cc3de3","tarball":"https://r.cnpmjs.org/chess-tcn/-/chess-tcn-0.1.0.tgz","fileCount":6,"unpackedSize":11084,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDZ2TUcylR7y323SvaEGHqwocrT7b6CGf9Q9o8tlj8SaAIhAPCoMEgL4kyMXe2MIuuXRzZRI5Tgo1XUSLlivPDe8rEm"}],"size":4041},"_npmUser":{"name":"chess-tcn","actor":{"name":"chess-tcn","type":"user","email":"debunk-bok-posting@duck.com"},"email":"debunk-bok-posting@duck.com"},"directories":{},"maintainers":[{"name":"chess-tcn","email":"debunk-bok-posting@duck.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chess-tcn_0.1.0_1751590891291_0.32081385811735763"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-04T01:01:31.462Z","publish_time":1751590891462,"_source_registry_name":"default"},"1.1.0":{"name":"chess-tcn","version":"1.1.0","description":"Encode and decode TCN, a move format used by Chess.com's API","main":"src/index.js","types":"src/index.d.ts","type":"module","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js"},"repository":{"type":"git","url":"git+https://github.com/chess-tcn/chess-tcn-js.git"},"keywords":["chess"],"author":{"name":"chess-tcn"},"license":"MIT","bugs":{"url":"https://github.com/chess-tcn/chess-tcn-js/issues"},"homepage":"https://github.com/chess-tcn/chess-tcn-js#readme","jest":{"roots":["<rootDir>/tests"],"testMatch":["**/tests/**/*.test.js"]},"dependencies":{"chess.js":"^1.4.0"},"devDependencies":{"@types/jest":"^30.0.0","eslint":"^9.30.1","jest":"^30.0.4"},"_id":"chess-tcn@1.1.0","gitHead":"b847b89d8b0f3367651ab8538c7dbdb79b74e4cd","_nodeVersion":"22.16.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-QZpfJeMdqv/ICdNu7rkFXoIdXGYKI22JAVRKk8jBGw+JnFM0XeIcKbYqE7t1axRwlyLlvd+VsoGsSIOM1TZ0AA==","shasum":"1ec1981a8d84a2394fcdca09173df345ef5cfafb","tarball":"https://r.cnpmjs.org/chess-tcn/-/chess-tcn-1.1.0.tgz","fileCount":6,"unpackedSize":11077,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC9m7vjkv8TQcTZsrq6IBw+7JvxpPxiHp2X9742TtDz0wIgYdAw238YjwzhLwQBe4sDoWKoeV/SBpHDViezQY01SxU="}],"size":4036},"_npmUser":{"name":"chess-tcn","email":"debunk-bok-posting@duck.com","actor":{"name":"chess-tcn","email":"debunk-bok-posting@duck.com","type":"user"}},"directories":{},"maintainers":[{"name":"chess-tcn","email":"debunk-bok-posting@duck.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chess-tcn_1.1.0_1751591605450_0.03530406767291128"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-04T01:13:25.637Z","publish_time":1751591605637,"_source_registry_name":"default"},"1.1.1":{"name":"chess-tcn","version":"1.1.1","description":"Encode and decode TCN, a move format used by Chess.com's API","main":"src/index.js","types":"src/index.d.ts","type":"module","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js"},"repository":{"type":"git","url":"git+https://github.com/chess-tcn/chess-tcn-js.git"},"keywords":["chess"],"author":{"name":"chess-tcn"},"license":"MIT","bugs":{"url":"https://github.com/chess-tcn/chess-tcn-js/issues"},"homepage":"https://github.com/chess-tcn/chess-tcn-js#readme","jest":{"roots":["<rootDir>/tests"],"testMatch":["**/tests/**/*.test.js"]},"dependencies":{"chess.js":"^1.4.0"},"devDependencies":{"@types/jest":"^30.0.0","eslint":"^9.30.1","jest":"^30.0.4"},"_id":"chess-tcn@1.1.1","gitHead":"8f771b44d71beb82ef4499fecc00892f5506ee41","_nodeVersion":"22.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-tWBh2vRvYZb5Aom7rdf3OOp0Uvxj8IFSOEf/szF13EOMV+lvdt0nRCY0ouVcRPAn1HBZUABAi1itW5oUlI18zQ==","shasum":"6b4ba6ab520d477b18bde3542458383017478723","tarball":"https://r.cnpmjs.org/chess-tcn/-/chess-tcn-1.1.1.tgz","fileCount":6,"unpackedSize":11504,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICcP3NQvtvHzgFmvCk5+/w31/E4vMzb0o9Q2YI7h84A/AiBWUU+g1/qT6xZEJVd7e5dLh+OklIdOonU5mHW9VEMraQ=="}],"size":4158},"_npmUser":{"name":"chess-tcn","email":"debunk-bok-posting@duck.com"},"directories":{},"maintainers":[{"name":"chess-tcn","email":"debunk-bok-posting@duck.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chess-tcn_1.1.1_1752807821282_0.04440427804496383"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-18T03:03:41.463Z","publish_time":1752807821463,"_source_registry_name":"default"}},"author":{"name":"chess-tcn"},"bugs":{"url":"https://github.com/chess-tcn/chess-tcn-js/issues"},"description":"Encode and decode TCN, a move format used by Chess.com's API","homepage":"https://github.com/chess-tcn/chess-tcn-js#readme","keywords":["chess"],"license":"MIT","maintainers":[{"name":"chess-tcn","email":"debunk-bok-posting@duck.com"}],"readme":"# Chess TCN JavaScript\n\n## Overview\n**Chess TCN JavaScript** is a JavaScript package designed to encode and decode TCN, a move format used by **Chess.com**'s API. This package allows developers to integrate TCN functionality into their web applications seamlessly.\n\n## What is TCN?\nTCN is a format used by **Chess.com** to transmit move lists in its JSON API. A typical endpoint for retrieving a game’s move list is:\n```\nhttps://www.chess.com/callback/live/game/{gameId}\n```\nThis endpoint returns a `moveList` field containing a TCN string.\n\n## Features\n- Decode TCN strings into PGN (Portable Game Notation).\n- Encode PGN back into TCN format.\n\n## Installation\nTo install the package, use `npm`:\n```bash\nnpm install chess-tcn\n```\n\n## Usage\nHere’s a quick example of how to use the package:\n\n```javascript\nimport { decodeTCN, encodeTCN, tcnToPgn, pgnToTcn } from \"chess-tcn\";\n\nconst tcnString = \"mC0Kgv7Tbq5Qlt9IqHT7cM1TMFWOHs2MFwZRfm6Eeg\";\n\n// Decode a raw TCN string into move objects\nconst moves = decodeTCN(tcnString);\nconsole.log(\"Decoded moves:\", moves);\n\n// Encode those move objects back into TCN\nconst newTcn = encodeTCN(moves);\nconsole.log(\"Re-encoded TCN:\", newTcn);\n\n// Convert a raw TCN string to PGN\nconst pgn = tcnToPgn(tcnString);\nconsole.log(\"PGN:\", pgn);\n\n// Convert PGN back into a TCN string\nconst newTcnString = pgnToTcn(pgn);\nconsole.log(\"New TCN string:\", newTcnString);\n```\n\n## API Reference\nFor complete details on usage, check out the [documentation](https://chess-tcn.github.io/docs).\n\n## License\nThis project is licensed under the MIT License. See below for full text.\n```\nMIT License\n\nCopyright (c) 2021-2025 chess-tcn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","repository":{"type":"git","url":"git+https://github.com/chess-tcn/chess-tcn-js.git"},"_source_registry_name":"default"}