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

@vitgranen/markie-sdk

v0.1.0

Published

TypeScript SDK for building apps on top of the Markie local asset library

Downloads

10

Readme

@markie/sdk

TypeScript SDK for building apps on top of Markie — your personal asset library.

Browse, search, upload, and display images, videos, PDFs, and design assets from your local Markie library in any web app.

Prerequisites

  1. Markie desktop app must be running (the SDK talks to its local server on localhost:3210)
  2. Developer Access must be enabled in Markie Settings > Developer tab

Install

npm install @markie/sdk

Quick Start

import { MarkieClient } from '@markie/sdk';

const markie = new MarkieClient();
await markie.connect();

// Browse assets
const { assets, total } = await markie.getCatalog({ limit: 20 });

// Display thumbnails
for (const asset of assets) {
  const url = markie.getThumbnailUrl(asset.id, 'sm');
  console.log(asset.originalName, url);
}

Use in HTML / React / Vue / Svelte

Thumbnail and file URLs don't require auth headers, so you can use them directly:

<img src="http://localhost:3210/api/assets/{id}/thumbnail" />

Or with the SDK:

<img src={markie.getThumbnailUrl(asset.id)} alt={asset.originalName} />

API Reference

Constructor

const markie = new MarkieClient({
  baseUrl?: string,  // Default: 'http://localhost:3210'
  token?: string,    // Pre-known token (skip connect())
});

Connection

| Method | Returns | Description | |--------|---------|-------------| | connect() | Promise<void> | Register and obtain a bearer token | | health() | Promise<boolean> | Check if Markie is running | | getInfo() | Promise<ServerInfo> | Server name, version, API version |

Catalog

const { assets, total } = await markie.getCatalog({
  limit: 50,          // Max assets to return
  offset: 0,          // Skip N assets (for pagination)
  since: '2024-01-01' // Only assets saved after this ISO date
});

Assets

| Method | Returns | Description | |--------|---------|-------------| | getAsset(id) | Promise<Asset> | Get a single asset by ID | | updateAsset(id, patch) | Promise<Asset> | Update tags, description, or category | | deleteAsset(id) | Promise<void> | Delete an asset |

Files & Thumbnails

| Method | Returns | Description | |--------|---------|-------------| | getThumbnailUrl(id, size?) | string | URL for thumbnail ('full', 'sm', 'xs') | | getFileUrl(id) | string | URL for original file | | getFile(id) | Promise<Blob> | Download original file as Blob |

Upload

const file = new File([buffer], 'photo.jpg', { type: 'image/jpeg' });
const { id } = await markie.save(file, {
  sourceUrl: 'https://example.com/photo.jpg',
  pageTitle: 'Example Gallery',
});

Search

// Requires Ollama embedding model configured in Markie
const results = await markie.search('mountain landscape');
// [{ id: '...', score: 0.87 }, ...]

const status = await markie.getSearchStatus();
// { available: true, model: 'nomic-embed-text', indexed: 450, total: 500 }

Plan

const plan = await markie.getPlan();
// { isPro: false, assetCount: 123, limit: 500 }

Error Handling

import {
  MarkieOfflineError,
  MarkieUnauthorizedError,
  MarkieLimitError,
} from '@markie/sdk';

try {
  await markie.save(file);
} catch (err) {
  if (err instanceof MarkieOfflineError) {
    // Markie desktop app is not running
  } else if (err instanceof MarkieLimitError) {
    // Free plan limit reached (500 assets)
  } else if (err instanceof MarkieUnauthorizedError) {
    // Token is invalid — call connect() again
  }
}

License

MIT