Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@jackstenglein/chess
Advanced tools
Built on top of chess.js and can handle variations (tree-structured move history)
@jackstenglein/chess is a TypeScript chess library based on chess.js and cm-chess. It provides PGN/FEN loading; move generation/validation; variations, including reordering and promoting; tracking the current move and seeking through a PGN; PGN header values; NAGs; comments; check/checkmate/stalemate detection; null moves; and more.
This library is used to power the ChessDojo annotation editor and tactics tests.
Run the following command to install the most recent version from NPM:
npm install @jackstenglein/chess
import { Chess } from '@jackstenglein/chess';
The code below plays a random game of chess:
import { Chess } from '@jackstenglein/chess';
const chess = new Chess();
while (!chess.isGameOver()) {
const moves = chess.moves();
const move = moves[Math.floor(Math.random() * moves.length)];
chess.move(move);
}
console.log(chess.renderPgn());
Also see the tests for further examples.
This is a headless library and does not include user interface elements. ChessDojo has successfully integrated this library with Lichess Chessground.
It has a similar API to chess.js and provides much of the same functionality. However, it also offers additional features:
FAQs
Built on top of chess.js and can handle variations (tree-structured move history)
We found that @jackstenglein/chess demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.