Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
chess-board
Advanced tools
A web component for displaying chess positions.
Import Web Components' polyfill:
<script src="//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.21/webcomponents.min.js"></script>
Import Custom Element:
<link rel="import" href="/bower_components/chess-board/dist/chess-board.html">
Start using it!
<chess-board>rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1</chess-board>
Attribute | Description |
---|---|
unicode | Display chess pices with unicode characters. |
frame | Display file and rank arround the chessboard |
reverse | Display the chessboard with black pieces at the bottom. |
Put the white queen on the a4 square
var board = new ChessBoard();
board.put("a4", "Q");
set a4 square empty
var board = new ChessBoard();
board.put("a4", "");
move a piece from a4 to a1
var board = new ChessBoard();
board.move("a4", "a1");
The pieces are defined as in Forsyth–Edwards Notation
P // ♙ white pawn
N // ♘ white knight
B // ♗ white bishop
R // ♖ white rook
Q // ♕ white queen
K // ♔ white king
p // ♟ black pawn
n // ♞ black knight
b // ♝ black bishop
r // ♜ black rook
q // ♛ black queen
k // ♚ black king
var board = new ChessBoard();
board.clearBoard();
var board = new ChessBoard();
board.fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
var board = new ChessBoard();
board.fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
board.move("a2", "a3");
var currentFen = board.fen;
MIT © Sigurd Fosseng
FAQs
A web component for displaying chess positions.
We found that chess-board demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.