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

@bedard/chess-types

v0.0.22

Published

[![Test](https://github.com/scottbedard/type-chess/actions/workflows/test.yml/badge.svg)](https://github.com/scottbedard/type-chess/actions/workflows/test.yml) [![NPM](https://img.shields.io/npm/v/%40bedard%2Fchess-types)](https://www.npmjs.com/package/@b

Downloads

22

Readme

@bedard/chess-types

Test NPM License

Welcome to a strange experiment to play chess inside TypeScript's type system.

Check out the sandbox →

Basic usage

Create a game and apply moves using {from}{to}{promotion?} strings. Castling is done via O-O and O-O-O syntax, lowercase for black.

import type {
  Chessboard,
  FormatGame,
  NewGame,
  NextMove,
} from '@bedard/chess-types'

type Game = NewGame<[
  'e2e4', 'e7e5',
  'g1f3', 'b8c6',
  'f1c4', 'f8c5',
  'O-O',  // ...
]>

type CpuMove = NextMove<Game> // <- play against the compiler!

type Board = Chessboard<Game> // <- hover to see the current board state

// {
//     8: " r * b q k * n r ";
//     7: " p p p p * p p p ";
//     6: " - * n * - * - * ";
//     5: " * - b - p - * - ";
//     4: " - * B * P * - * ";
//     3: " * - * - * N * - ";
//     2: " P P P P - P P P ";
//     1: " R N B Q * R K - ";
// }

// finally, export the game as a string using FEN notation

type Fen = FormatGame<Game> // 'r1bqk1nr/pppp1ppp/2n5/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQ1RK1 b kq - 5 4'

There are loads of other interesting types under the hood, like IsLegal, ParseFen, and Evaluate. So if you're into that kind of thing, by all means dig around and let me know what you think!

Side note, NextMove uses an extremely naive strategy. It simply adds up all the pieces and chooses the move with the best score. There are many improvements that could be made, but that was never the plan here. My goal was to play chess inside the compiler, not to build stockfish.

Final thoughts

TypeScript is amazing.

It's type system can be thought of as it's own purely functional language, but for obvious reasons it shouldn't be used as one. There was no practical reason for any of this beyond learning, but in that sense I've enjoyed it and feel like I've succeeded. More specifically, I've gained a new appreciation for the recursive accumulator pattern, and generic type inference.

If you find this repo interesting, here are some others you may like!

License

MIT

Copyright (c) 2025-present, Scott Bedard