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

@zlayer/sdk

v0.9.962

Published

ZLayer Plugin Development Kit for TypeScript

Readme

ZLayer TypeScript SDK

The ZLayer Plugin Development Kit (PDK) for TypeScript enables you to build WebAssembly plugins that run in the ZLayer runtime.

Requirements

  • Node.js 20.0.0 or later
  • npm or pnpm

Installation

npm install @zlayer/sdk

Or with pnpm:

pnpm add @zlayer/sdk

Quick Start

  1. Initialize a new plugin project:
mkdir my-plugin && cd my-plugin
npm init -y
npm install @zlayer/sdk
  1. Create your plugin entry point:
// src/index.ts
import { VERSION } from '@zlayer/sdk';

console.log(`Using ZLayer SDK v${VERSION}`);

// Your plugin implementation here
  1. Build to WebAssembly:
npm run build

Project Structure

my-plugin/
├── src/
│   └── index.ts          # Plugin entry point
├── dist/                  # Compiled JavaScript output
├── package.json
└── tsconfig.json

Generating WIT Bindings

The SDK uses jco to generate TypeScript bindings from WIT (WebAssembly Interface Types) definitions.

To regenerate bindings from the ZLayer WIT definitions:

npm run generate

This will read the WIT files from ../wit/zlayer and output TypeScript bindings to src/bindings/.

Available Scripts

| Script | Description | |--------|-------------| | npm run build | Compile TypeScript to JavaScript | | npm run generate | Generate WIT bindings using jco | | npm run clean | Remove the dist directory | | npm run test | Run tests with Vitest | | npm run lint | Lint source files with ESLint | | npm run format | Format source files with Prettier |

Configuration

TypeScript

The SDK is configured for ES2022 with NodeNext module resolution. See tsconfig.json for full configuration.

ESLint

ESLint is configured with TypeScript support. See .eslintrc.json for rules.

Prettier

Prettier is configured for consistent code formatting. See .prettierrc for options.

Examples

Check the examples/ directory for sample plugin implementations.

Host Capabilities

Plugins built with this SDK can access ZLayer host capabilities through the generated WIT bindings:

  • HTTP Requests - Make outbound HTTP requests
  • Key-Value Storage - Persist data across plugin invocations
  • Logging - Structured logging to the host
  • Configuration - Access plugin configuration
  • Events - Subscribe to and emit events

Building for Production

For production builds, ensure you:

  1. Run the full build process:

    npm run clean && npm run build
  2. Test your plugin:

    npm run test
  3. Lint and format:

    npm run lint && npm run format

License

MIT