npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@neochess/core

v1.0.3

Published

[![npm version](https://badge.fury.io/js/%40neochess%2Fcore.svg)](https://badge.fury.io/js/%40neochess%2Fcore) [![Build Status](https://travis-ci.org/luismanuelamengual/Neochess-Core.svg?branch=main)](https://travis-ci.org/luismanuelamengual/Neochess-Core

Readme

npm version Build Status

Neochess-Core

Neochess-Core is a Javascript chess library that supports move validation/generation, piece placement/movement and detection of check/checkmate/draw situations. This library supports moves in SAN notation and also supports FEN notation for static positions and PGN notation for dynamic chess matches.

This library has been extensively tested with Jest.

Installation

npm install @neochess/core

Getting started

Import the "Match" (Dynamic view) or "Board" (Static view) object and start playing ...

// Import the "Match" class from @neochess/core
import {Match} from "@neochess/core";

// Create a match
const match = new Match();

// Create a match starting from a valid FEN position 
const matchFEN = new Match('1k6/3R4/4P3/8/3b2r1/8/5r2/7K w - - 0 1');

Examples

Getting information from a position

const match = new Match();
console.log('Piece at e2: ' + match.getPiece(Square.E2));
console.log('Side To Move: ' + match.getSideToMove());
console.log('Move Counter: ' + match.getMoveCounter());
console.log('Half Move Counter: ' + match.getHalfMoveCounter());
console.log('En Passant Square: ' + match.getEPSquare());
console.log('FEN: ' + match.getFEN());

Making Moves

// Making single moves
match.makeMove('e4');
match.makeMove('e5');
match.makeMove('Qh5');

// Making multiple moves
match.makeMoves(['Nc6', 'Bc4', 'd6', 'Qxf7#']);

Getting valid moves

const match = new Match('r1bqkbnr/ppppp1pp/2n2P2/8/8/8/PPPP1PPP/RNBQKBNR b KQkq - 0 3');
console.log(match.getValidMoves());

Moving between match nodes

match.goToNextPosition();  // Moving forward
match.goToPreviousPosition();  // Moving backwards
match.goToStartPosition();  // Move to root position
match.goToCurrentPosition();  // Move to current (main line) position
match.goToPosition(2);  // Move to position at ply 2

Working with PGN Notation

// Loading a PGN
match.setPGN('1.e4 $1 e5 2.Bc4 (2.Nf3 Bb4 {Estoy en una variante} 3.c3) 2...Nc6 3.Qh5 *');

// Obtaining a PGN
match.getPGN();

Adding comments on positions

match.addPositionComments('We are in a crucial moment');  // Adding comments to a position
match.getPositionComments();  // Obtaining the position comments
match.clearPositionComments();  // Removing comments of the position

Adding annotations on positions

// Adding annotations
match.addPositionAnnotation(Annotation.VERY_GOOD_MOVE);
match.addPositionAnnotation(Annotation.QUESTIONABLE_MOVE);

// Getting annotations
match.getPositionAnnotations();

// Removing annotations
match.clearPositionAnnotations();

Listening for match events

// Listening for position changes
match.addEventListener('positionChange', () => {
   console.log('Position changed !!');
});

// Listening for moves made
match.addEventListener('moveMade', (move) => {
    console.log('Move made !!');
    console.log(move);
});

Contact

For bugs or for requirements please contact me at [email protected]