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

mrkr

v0.1.0

Published

`mrkr` is a lightweight TypeScript library providing a `markable` template tag. It allows you to create strings with embedded markers to easily track positions, compose strings, and split them at marked locations.

Readme

mrkr

mrkr is a lightweight TypeScript library providing a markable template tag. It allows you to create strings with embedded markers to easily track positions, compose strings, and split them at marked locations.

Features

  • Create strings with markers using a simple template literal syntax.
  • Automatically tracks the start and end positions of markers.
  • Compose markable strings together, preserving marker information.
  • Use markRef to create references to specific markers and find their offsets.
  • Split strings into parts using the cut() method.
  • Fully typed with TypeScript.

Installation

Install the dependencies:

pnpm install

Usage

Basic Marking

Import markable and mark to create your first marked string. The mark symbol indicates where a marker should be placed.

import { markable, mark as v } from 'mrkr';

const str = markable`Hello, ${v}world!`;

console.log(str.toString()); // "Hello, world!"

// Get the position of the first and last marks
console.log(str.start);      // 7
console.log(str.end);        // 7

Multiple Markers and cut()

You can place multiple marks. The cut() method will split the string at each marker.

import { markable, mark as v } from 'mrkr';

const str = markable`foo${v}bar${v}baz`;

console.log(str.cut()); // ['foo', 'bar', 'baz']
console.log(str.start); // 3
console.log(str.end);   // 6

Composition

markable strings can be nested and composed seamlessly.

import { markable, mark as v } from 'mrkr';

const foo = markable`fo${v}o`;
const bar = markable`b${v}ar`;
const foobar = markable`${foo}${v}${bar}`;

console.log(foobar.toString()); // "foobar"
console.log(foobar.start);      // 2 (from foo)
console.log(foobar.end);        // 4 (from bar)

// .cut() splits at all nested and new marks
console.log(foobar.cut());      // ['fo', 'o', 'b', 'ar']

markRef for Tagged Markers

For more advanced control, markRef allows you to create a reference to a marker. This reference can be used to find the offset of that specific marker, even in composed strings.

import { markable, markRef } from 'mrkr';

const nameRef = markRef();
const greeting = markable`Hello, ${nameRef}John Doe!`;

// Find the position of the marker using the reference
const namePosition = nameRef.offsetFrom(greeting);
// You can also get it from the string instance
// const namePosition = greeting.offsetOf(nameRef);

console.log(namePosition); // 7
console.log(greeting.substring(greeting.start)); // "John Doe!"

// The reference works across compositions
const announcement = markable`Attention! ${greeting}. Welcome.`;
const namePositionInAnnouncement = nameRef.offsetFrom(announcement);

console.log(namePositionInAnnouncement); // 18

Development

Build the library:

pnpm run build

Build the library in watch mode:

pnpm run dev