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

jmap-kit

v1.0.3

Published

A comprehensive, type-safe JMAP SDK for building JMAP-based client applications

Downloads

540

Readme

jmap-kit

GitHub npm

A typed TypeScript library for building JMAP clients. It handles session discovery, request building with type-safe invocation factories, response dispatching, file operations, and a plugin system for validation and transformation — so you can focus on your application instead of the protocol.

See the complete jmap-kit Documentation.

Using jmap-kit

Features

  • Session management: automatic discovery via .well-known/jmap, session state tracking, staleness detection
  • Type-safe invocations: factory functions for every JMAP method, with compile-time enforcement of argument types and property names
  • Result references: chain dependent method calls within a single request without extra round trips
  • Request building: combine multiple method calls into one request with automatic capability URI inclusion and ID management
  • Response dispatching: route responses to handlers by method name, data type, or invocation ID
  • File operations: upload and download with server limit enforcement and automatic concurrency control
  • Plugin system: validation and transformation hooks at each stage of request processing
  • Server limit enforcement: built-in validators for maxObjectsInGet, maxObjectsInSet, maxCallsInRequest, maxSizeRequest, and read-only accounts
  • Extensible: define custom capabilities with their own types, invocations, validators, and transformers

Installation

npm install jmap-kit
yarn add jmap-kit
pnpm add jmap-kit

Quick Example

import { JMAPClient, EmailCapability, Mailbox } from "jmap-kit";

const transport = /* your HTTP transport (see Developer Guide) */;
const client = new JMAPClient(transport, { hostname: "api.example.com" });
client.registerCapabilities(EmailCapability);

await client.connect();

const accountId = client.primaryAccounts["urn:ietf:params:jmap:mail"];

// Query for the Inbox, then fetch it — in a single request
const query = Mailbox.request.query({
    accountId,
    filter: { role: "inbox" },
});

const get = Mailbox.request.get({
    accountId,
    ids: query.createReference("/ids"),
    properties: ["id", "name", "role", "totalEmails", "unreadEmails"],
});

const request = client.createRequestBuilder().add(query).add(get);
const response = await request.send();

await response.methodResponses.dispatch({
    "Mailbox/get": (invocation) => {
        const mailboxes = invocation.getArgument("list");
        console.log("Inbox:", mailboxes);
    },
    error: (invocation) => {
        console.error("Error:", invocation.type);
    },
});

await client.disconnect();

Documentation

See the Developer Guide for comprehensive documentation covering session management, capabilities, invocations, request building, response handling, file operations, customisation, the plugin system, and creating custom capabilities.

Development

Setup

git clone <repository-url>
cd jmap-kit
yarn install

Scripts

| Command | Description | | ------------------- | ------------------------------------------------------------------- | | yarn test | Run tests in interactive watch mode (Vitest) | | yarn test --run | Run all tests once (CI) | | yarn format:check | Check Prettier formatting | | yarn lint | Run ESLint (--fix to auto-fix) | | yarn typecheck | Type-check without emitting files | | yarn build | Compile TypeScript | | yarn bundle | Build bundles with Rollup (for analysis, not shipped) | | yarn size-check | Bundle and print file sizes | | yarn docs | Generate API docs with TypeDoc |

Contributing

Contributions are welcome! See the Contributing Guide for development setup, conventions, and PR guidelines.

Roadmap

jmap-kit currently implements the JMAP Core (RFC 8620), Mail (RFC 8621), and Blob Management (RFC 9404) specifications, plus the FastMail Masked Email extension. The following features are planned for future minor releases.

Core specification features

  • PushSubscription (RFC 8620 Section 7.2) — PushSubscription/get and PushSubscription/set methods for managing push notification subscriptions
  • EventSource (RFC 8620 Section 7.3) — built-in client for server-sent events, including connection management and automatic reconnection (URL generation via getEventSourceUrl() is already available)

Additional JMAP capabilities

Support for capabilities defined in other published and draft JMAP specifications is planned, including:

Any of the above capabilities can be implemented as custom capabilities using the plugin system. Contributions are welcome!

Other specifications

License

MIT License