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

@nexora-hrittik/sim-insertion-sort

v1.0.0

Published

Insertion Sort interactive algorithm simulation module for Nexora

Readme

Insertion Sort Simulation

Official contributor simulation package implementing an interactive, deterministic, pedagogical visualizer for Insertion Sort in the Nexora learning ecosystem.

This package conforms directly to the @nexora-hrittik/sdk runtime contract and integrates with the standalone developer harness.


1. Features

  • Observable Operation Granularity: Every comparison ($A[j] > \text{key}$), element shift ($A[j+1] \leftarrow A[j]$), key placement ($A[j+1] \leftarrow \text{key}$), and pass completion is exposed as an individual, deterministic state step.
  • Accurate Metric Telemetry: Live tracking of comparisons, shifts, key placements, pass progress, and total steps.
  • Preserved Invariants: Strictly enforces loop invariant $A[0 \dots i-1]$ sorted order and stability.
  • Interactive Control Stage: Presets for Random, Nearly-Sorted, Reversed, Few-Unique, and Custom input with real-time validation.
  • Educational Integration: Formulated theory, guided inquiries, academic citations, and asymptotic complexity references.

2. Contributor Verification Commands

# 1. Verify simulation metadata conformance against canonical topic taxonomy
npm run validate:metadata

# 2. Check strict architectural boundaries (zero illegal platform leaks)
npm run check:boundary

# 3. Static typechecking against SDK definitions
npm run typecheck

# 4. Execute unit, invariant, and contract tests
npm test

# 5. Build standalone production preview
npm run build

# 6. Start local standalone preview
npm run dev

3. Architecture & File Structure

Insertion-Sort/
├── package.json              # Package manifest (@nexora-hrittik/simulation-template)
├── tsconfig.json             # TypeScript compiler options
├── vite.config.ts            # Vite bundler configuration
├── index.html                # Entrypoint mounting dev harness
├── docs/
│   ├── 01-overview.md        # Pedagogical overview & intuition
│   └── 02-algorithm.md       # Invariant proof, pseudocode, and complexities
├── scripts/
│   ├── check-boundary.js     # Enforces zero platform leaks
│   └── validate-metadata.js  # Validates metadata against canonical taxonomy
├── tests/
│   ├── contract.test.ts      # Automated SDK contract & lifecycle verification
│   ├── harness.test.tsx      # Standalone preview harness invariant tests
│   └── logic.test.ts         # Vitest unit tests for insertion sort invariants
└── src/
    ├── index.ts              # Primary SimulationModule export
    ├── types.ts              # Strongly typed State, Config, and StepLog
    ├── logic.ts              # Pure deterministic state machine transitions
    ├── visualization.tsx     # Visual canvas rendering array elements and roles
    ├── controls.tsx          # User controls (presets, array size, custom inputs)
    ├── content.ts            # Theory, formulas, guided inquiries, and references
    ├── dev.tsx               # Preview harness mount (<SimulationPreviewHarness />)
    └── index.css             # Tailwind v4 styles, theme tokens, and typography

4. Complexity Reference

  • Best-Case Time: $O(n)$ (Nearly-sorted / already-sorted input)
  • Average-Case Time: $O(n^2)$
  • Worst-Case Time: $O(n^2)$ (Reverse-sorted input)
  • Auxiliary Space: $O(1)$ (In-place)
  • Stability: Stable ($A[j] > \text{key}$ strictly prevents equal elements from crossing)

License

This project is licensed under the MIT License.