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

@shipworthy/anchor

v0.1.0

Published

TypeScript SDK that powers the [Anchor](../../README.md) ecosystem. Import it in your own scripts or applications to programmatically query monitors, inspect window positions, and persist/restore layouts.

Downloads

9

Readme

@shipworthy/anchor

TypeScript SDK that powers the Anchor ecosystem. Import it in your own scripts or applications to programmatically query monitors, inspect window positions, and persist/restore layouts.

The SDK is macOS-only for now – it relies on AppleScript under the hood. A cross-platform backend is on the roadmap.


Install

npm i @shipworthy/anchor      # or yarn / pnpm

Because we publish ES Modules, make sure your package.json has "type": "module" or use dynamic import().

API Overview

import {
  applyWindowAnchors,
  checkPermission,
  getWindowAnchors,
  hashMonitorAnchors,
  list,
  load,
  remove,
  save,
} from "@shipworthy/anchor";

// 0. Check/request accessibility permissions (required on macOS)
const hasPermission = await checkPermission();
if (!hasPermission) {
  console.error("Please grant accessibility permissions and try again");
  process.exit(1);
}

// 1. Capture current layout and save it
const windows = await getWindowAnchors();
await save({
  id: crypto.randomUUID(),
  name: "my-setup",
  timestamp: new Date(),
  monitors: [/* fetched via monitorService (coming soon) */],
  windows,
  monitorHash: hashMonitorAnchors([]),
});

// 2. Restore later
const layout = await load("my-setup");
await applyWindowAnchors(layout.windows);

Services

windowService – List open windows and move/resize them.
stateService – Save / load layouts to ~/.anchor/states.
permissionService – Check and request macOS accessibility permissions.
utils – Hashing, auto-naming & bounds-clamping helpers.

Additional services (monitorService, native provider bindings) will land in future minor versions.

macOS Permissions

Anchor requires accessibility permissions to read window information and control window positions. The SDK provides helper functions:

import { 
  checkPermission,
} from "@shipworthy/anchor";

// Check if permissions are granted
const hasPermission = await checkPermission();

Development

# At repo root
yarn dev       # incremental build in watch mode

# Unit tests
yarn test -F core

All source lives in src/ and is compiled with tsup to ESM + d.ts files in dist/.

License

MIT

Features

  • Window state management (position, size, monitor)
  • Monitor detection and multi-monitor support
  • Layout persistence and restoration
  • Permission checking for macOS accessibility

Window Restoration Behavior

When restoring window layouts, Anchor uses intelligent matching:

  1. Exact Match: First attempts to find and position windows with matching app name AND window title
  2. App-Based Fallback: If no exact match is found, positions the frontmost window of the matching app

This means that applications like Arc browser will be restored to their saved positions even when browsing different tabs (which changes the window title). The same applies to code editors when different files are open.