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

@vimee/testkit

v0.1.1

Published

Test utilities for writing @vimee/core vim operation tests

Readme

@vimee/testkit

Test utilities for writing @vimee/core Vim operation tests

npm License: MIT

A fluent test harness that wraps @vimee/core so you can write concise, readable Vim operation tests.

Install

npm install -D @vimee/testkit

Requires @vimee/core >= 0.1.0 as a peer dependency.

Quick Start

import { vim } from "@vimee/testkit";

const v = vim("hello\nworld");
v.type("dd");
expect(v.content()).toBe("world");

API Reference

vim(text, opts?)

Factory function that creates a VimHarness instance.

| Parameter | Type | Description | |-----------|------|-------------| | text | string | Initial buffer content | | opts | VimOptions? | Options (see below) |

VimOptions

| Field | Type | Default | Description | |-------|------|---------|-------------| | cursor | [number, number] | [0, 0] | Initial cursor [line, col] (0-based) | | mode | VimMode | "normal" | Initial mode | | anchor | [number, number] | — | Visual anchor [line, col] (for visual modes) | | indentStyle | "space" \| "tab" | "space" | Indent character | | indentWidth | number | 2 | Spaces per indent level |

VimHarness

.type(keys, insertText?)

Send a key sequence to the Vim engine. Returns this for chaining.

  • keys — Vim-style key notation (e.g., "dd", "<C-d>", "ciw")
  • insertText — Optional text to type after keys, automatically followed by <Esc>
// Delete a word and replace it
v.type("ciw", "replacement");

// Chain multiple operations
v.type("gg").type("dd").type("p");

.content()

Get the full buffer content as a string.

.cursor()

Get the current cursor position as { line, col } (0-based).

.mode()

Get the current Vim mode.

.lines()

Get all lines as a string[].

.line(index)

Get a specific line by 0-based index.

.register(name)

Get the content of a register. Use '"' for the unnamed register.

v.type("yy");
expect(v.register('"')).toBe("hello\n");

.actions()

Get VimAction[] emitted by the last .type() call.

.allActions()

Get all VimAction[] emitted since creation.

.statusMessage()

Get the current status bar message.

.raw()

Access the raw { ctx: VimContext, buffer: TextBuffer } for advanced assertions.

Key Notation

The parseKeys function (also exported) converts Vim-style key notation to key inputs:

| Notation | Result | |----------|--------| | dd | ["d", "d"] | | <Esc> | ["Escape"] | | <Enter> / <CR> | ["Enter"] | | <BS> | ["Backspace"] | | <Tab> | ["Tab"] | | <Space> | [" "] | | <C-d> | [{ key: "d", ctrlKey: true }] | | dd<C-r> | ["d", "d", { key: "r", ctrlKey: true }] |

Examples

import { vim } from "@vimee/testkit";

// Test motions
const v1 = vim("hello world");
v1.type("w");
expect(v1.cursor()).toEqual({ line: 0, col: 6 });

// Test with initial cursor position
const v2 = vim("line1\nline2\nline3", { cursor: [1, 0] });
v2.type("dd");
expect(v2.content()).toBe("line1\nline3");

// Test visual mode
const v3 = vim("hello world");
v3.type("vllld");
expect(v3.content()).toBe("o world");

// Test insert mode with auto-escape
const v4 = vim("hello");
v4.type("A", " world");
expect(v4.content()).toBe("hello world");
expect(v4.mode()).toBe("normal");

License

MIT