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

typeferry

v0.13.1

Published

Type-safe real-time RPC framework for TypeScript

Readme

typeferry

The TypeScript implementation of TypeFerry provides the reference Node.js server, browser/Node client, React hooks, authentication helpers, EJSON, and an optional MongoDB extension.

Install the public TypeScript package with npm install typeferry. Repository contributors can use the local template/ workflow described in the quickstart.

AI coding agents building consumer applications should begin with the agent application guide. It defines the supported project structure, public imports, package-owned commands, optional configuration, safety boundaries, and completion checks.

Runtime requirements

  • Node.js 24.19.0
  • npm 11.17.0
  • Node.js for the server runtime
  • A browser or WebSocket-capable JavaScript runtime for clients

Public entry points

| Import | Purpose | |---|---| | typeferry/server | Server, methods, events, channels, and runtime types | | typeferry/server/decorators | Namespace and method decorators | | typeferry/server/transports | Node HTTP, WebSocket, and Redis transports | | typeferry/client | Core client and connection APIs | | typeferry/react | React provider and hooks | | typeferry/auth | Shared auth, token, session, and cookie helpers | | typeferry/auth/server/oauth | Server OAuth providers | | typeferry/auth/client/oauth | Client OAuth helpers | | typeferry/ejson | Extended JSON namespace | | typeferry/minimongo | Immutable, event-driven local document collections | | typeferry/mongodb | Native-driver MongoDB extension | | typeferry/mongodb/decorators | MongoDB collection decorators | | typeferry/config | Optional typed application configuration | | typeferry/test | Unstable mirror of the installed Vitest API |

Applications should import these compiled package exports. Do not alias or import TypeFerry source files from application code.

Application commands

Applications using the conventional root-level client/, common/, server/, and test/ directories need no TypeFerry configuration:

{
  "scripts": {
    "develop": "typeferry develop",
    "build": "typeferry build",
    "test": "typeferry test"
  }
}

typeferry test unit, typeferry test integration, and typeferry test browser select one project. Add --watch for watch mode. Tests can import Vitest through typeferry/test:

import { describe, expect, it } from 'typeferry/test'

That entry point mirrors TypeFerry's installed Vitest release. Individual mirrored exports follow Vitest and do not carry independent TypeFerry compatibility guarantees.

Add typeferry.config.ts only when overriding supported high-level defaults:

import { defineConfig } from 'typeferry/config'

export default defineConfig({
  development: {
    clientPort: 8000,
    serverPort: 8002,
  },
  build: {
    server: {
      external: ['sharp'],
    },
  },
})

Server dependencies are bundled by default. Configured externals must be direct application dependencies, and the application must ship them in its production runtime installation.

See the full application framework guide for command behavior, test discovery, every configuration field, migration, ownership boundaries, upgrades, and troubleshooting.

Define and serve a typed method

import { Server } from 'typeferry/server'
import type { ClientNode } from 'typeferry/server'
import {
  type InferNamespace,
  Method,
  Namespace,
  registerNamespace,
  Schema,
} from 'typeferry/server/decorators'
import { z } from 'zod'

const greetingSchema = z.object({
  name: z.string().trim().min(1),
})

type GreetingInput = z.infer<typeof greetingSchema>

@Namespace('greeting')
export class GreetingMethods {
  @Method()
  @Schema(greetingSchema)
  async hello(
    _client: ClientNode,
    input: GreetingInput,
  ): Promise<string> {
    return `Hello, ${input.name}!`
  }
}

export type GreetingApi = InferNamespace<GreetingMethods, 'greeting'>

const server = new Server({ host: '127.0.0.1', port: 8002 })
registerNamespace(GreetingMethods)
await server.isReady()

Clients can call the method as client.m.greeting.hello({ name: 'Ada' }) when parameterized with GreetingApi. The decorators turn the class method into an HTTP and WebSocket RPC endpoint, while @Schema() validates network input at runtime. The Server constructor installs both transports; call server.close() during graceful shutdown.

Development

Run commands from typeferry-ts/:

The package and all of its tests share the strict compiler contract in tsconfig.json; tsconfig.build.json only selects production inputs and emit settings.

npm ci
npm run lint
npm run typecheck
npm test
npm run build
npm pack --dry-run

Guides

Start at the documentation home or jump to the application framework, server and RPC, client, React, authentication, events and channels, MongoDB, EJSON, or deployment.