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 🙏

© 2025 – Pkg Stats / Ryan Hefner

algo-practice

v1.0.1

Published

A CLI-first algorithm practice tool for TypeScript/Node.js

Downloads

8

Readme

algo-practice

A CLI-first algorithm practice tool for TypeScript/Node.js that provides spoiler-free practice environments and tracks attempt history across Windows, Linux, and macOS.

Installation

# Install globally from npm
npm install -g algo-practice

# Or install locally in your project
npm install algo-practice

# Or build from source
git clone https://github.com/chris-amaya/algo.git
cd algo
pnpm install
pnpm build
npm install -g .

Usage

Basic Commands

# Create a new problem
algo new

# Start practicing a problem
algo practice <slug>

# Run tests for current problem
algo test

# Run tests in watch mode
algo watch [slug]

# Submit your solution
algo submit [-n "note"]

# Resume active sandbox
algo resume

# View past attempts
algo reveal [slug]

# Get help
algo --help

Development Workflow

The CLI follows a two-phase spoiler-free design:

Phase 1: Problem Registration (algo new)

  • Interactive wizard to set up problem structure
  • Creates problems/<slug>/ with:
    • prompt.md - Problem description
    • tests.ts - Test cases (no solutions visible)
    • meta.json - Metadata and attempt history
    • solutions/ - Directory for archived attempts
  • Note: No solution.ts is created here to keep it spoiler-free

Phase 2: Practice Session (algo practice <slug>)

  • Creates isolated sandbox in sandbox/<slug>/
  • Copies test file without revealing solutions
  • Creates solution.ts with intelligent stub based on test analysis
  • Workspace is completely separate from problem definition

Development Loop

  1. Run tests: algo test or algo watch

    • Uses Vitest to run tests against your solution
    • Watch mode automatically reruns on file changes
  2. Submit solution: algo submit

    • Archives your solution with timestamp to problems/<slug>/solutions/
    • Records attempt metadata (passed/failed, notes)
    • Keeps solution history for later review
  3. Review attempts: algo reveal

    • View all past attempts without spoilers
    • Compare different approaches over time

Why This Design?

  • Spoiler-Free: Problem definitions never contain solutions
  • Multiple Attempts: Each practice session is isolated
  • Clean Separation: Problem registry vs. active workspaces
  • History Tracking: All attempts are preserved chronologically

Directory Structure

algo/
├── problems/                 # Your problem collection
│   └── <slug>/
│       ├── prompt.md        # Problem description
│       ├── meta.json        # Metadata and attempt history
│       ├── tests.ts         # Test cases
│       └── solutions/       # Archived solutions
├── sandbox/                 # Active practice area (gitignored)
│   ├── <slug>/
│   │   ├── solution.ts      # Your current work
│   │   └── tests.ts         # Copied test file
│   └── _active.json         # Tracks active sandboxes
└── src/                     # CLI source code

Development Commands

# Run in development mode
pnpm dev

# Run tests
pnpm test
pnpm test:coverage

# Type checking
pnpm typecheck

# Linting
pnpm lint

# Build for production
pnpm build

Features

  • Spoiler-Free Practice: Sandbox completely isolated from solutions
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Test-Driven: Integrated Vitest workflow encourages TDD
  • Attempt History: Track your progress over time
  • TypeScript First: Full TypeScript support with type checking

Examples

# Create a new two-sum problem
algo new
# Enter: two-sum, Two Sum, easy

# Start practicing
algo practice two-sum

# Run tests in watch mode
algo watch

# Submit when ready
algo submit -n "O(n) hash table solution"

# View all attempts later
algo reveal two-sum

License

ISC