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

@terminalgames/ink-2048

v0.1.0

Published

Terminal 2048 built with Ink.

Downloads

14

Readme

Ink 2048

Terminal 2048 built with Ink. Turn-based, no timer — slide the board, merge tiles, and chase the 2048 star. The board renders as a real square grid of chunky tiles, the freshly spawned tile is highlighted each turn, and you can resize the board (3×3 to 6×6) on the fly. Your best score persists between sessions, tracked per board size.

Install

Requires Node 20+.

The unscoped name ink-2048 is already taken on npm, so this package publishes as @terminalgames/ink-2048. The command is still ink-2048.

Run without installing (easiest)

npx @terminalgames/ink-2048

Global install

If npm install -g fails with EACCES, your npm global prefix is probably system-owned (/usr/local). Either use npx above, or point npm at a user-owned directory:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
npm install -g @terminalgames/ink-2048

Then:

ink-2048

Controls

The essential controls are always shown in the sidebar, so there's nothing to memorize on a first run.

| Key | Action | | --- | --- | | h / | Slide left | | l / | Slide right | | k / | Slide up | | j / | Slide down | | + / = | Grow the board (up to 6×6) | | - / _ | Shrink the board (down to 3×3) | | c | Keep playing (after reaching 2048) | | r / enter | Restart | | ? | Toggle the full help reference | | q | Quit |

Resizing the board starts a fresh game at the new size. Your best for the size you're leaving is saved first, and the new size loads its own best.

Command-line options

ink-2048 --size 5      # start on a 5×5 board (3–6, default 4)
ink-2048 --seed 12345  # reproducible tile spawns
ink-2048 --help        # usage

Persistent best scores are written to $XDG_CONFIG_HOME/ink-2048/scores.json (falling back to ~/.config/ink-2048/scores.json). Set INK_2048_DATA_DIR to override the location. If that file can't be written, the game plays fine and simply skips saving.

Rules

  • Played on a square grid (default 4×4, configurable 3×3 to 6×6) that starts with two random tiles (90% are 2s, 10% are 4s).
  • Each slide pushes every tile as far as it can go in that direction; equal adjacent tiles merge into their doubled value, and each tile merges at most once per move.
  • A new tile spawns in a random empty cell after every move that changes the board (highlighted so you can see what changed). Moves that change nothing are ignored.
  • Score is the sum of all merged tile values; Best is your saved best for the current board size; Moves counts board-changing slides.
  • Reach the 2048 tile to win — then press c to keep playing toward higher tiles. The win target is 2048 at every size, so the smaller boards are a real expert challenge.
  • You lose when the board is full and no merges remain.

Development

npm install
npm run build
node dist/cli.js
npm test
npm run typecheck

Game logic lives in pure TypeScript modules under src/game/ (deterministic, seeded RNG); Ink UI is under src/ui/.

Publish

Maintainers only. Requires access to the @terminalgames npm organization:

npm login
npm publish --access public