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

@kalxjs/edge

v1.0.4

Published

Edge Computing support for KalxJS - Cloudflare Workers, Deno Deploy, and edge runtime optimization

Readme

@kalxjs/edge

Edge Computing support for KalxJS Framework - Build ultra-fast edge applications with Cloudflare Workers, Deno Deploy, and Vercel Edge Functions.

Features

  • 🚀 Multiple Edge Runtimes - Cloudflare Workers, Deno Deploy, Vercel Edge, Netlify Edge
  • 🎯 Automatic Runtime Detection - Detect and adapt to any edge environment
  • Edge-Optimized SSR - Streaming SSR with minimal overhead
  • 🗺️ Geographic Routing - Route requests based on user location
  • 💾 Smart Caching - 5 cache strategies with TTL management
  • 🔧 Middleware System - CORS, rate limiting, authentication, logging
  • 📦 Platform-Specific APIs - Full access to KV, Durable Objects, etc.

Installation

npm install @kalxjs/edge

Quick Start

Cloudflare Workers

import { createWorkerHandler, WorkerKV } from '@kalxjs/edge/cloudflare';
import { createApp } from '@kalxjs/core';

const handler = createWorkerHandler({
  middleware: [/* your middleware */]
});

export default {
  async fetch(request, env, ctx) {
    return handler(request, env, ctx);
  }
};

Deno Deploy

import { createDenoHandler, DenoKV } from '@kalxjs/edge/deno';

const handler = createDenoHandler({
  middleware: [/* your middleware */]
});

Deno.serve(handler);

Vercel Edge Functions

import { createEdgeHandler, NextResponse } from '@kalxjs/edge/vercel';

export default createEdgeHandler({
  middleware: [/* your middleware */]
});

export const config = {
  runtime: 'edge'
};

Core Features

Runtime Detection

import { detectRuntime, getRuntimeCapabilities } from '@kalxjs/edge';

const runtime = detectRuntime();
const capabilities = getRuntimeCapabilities();

console.log(`Running on: ${runtime}`);
console.log(`Supports streaming: ${capabilities.supportsStreaming}`);

Edge-Optimized Rendering

import { renderToEdgeStream } from '@kalxjs/edge';
import { createApp } from '@kalxjs/core';

export default {
  async fetch(request) {
    const app = createApp(/* your app */);
    return renderToEdgeStream(app, { request });
  }
};

Cache Strategies

import { EdgeCacheManager } from '@kalxjs/edge';

const cache = new EdgeCacheManager();

// Cache-first strategy
await cache.match(request, async () => {
  return new Response('data');
}, { strategy: 'cache-first', ttl: 3600 });

Middleware System

import { MiddlewareManager, corsMiddleware, rateLimitMiddleware } from '@kalxjs/edge';

const manager = new MiddlewareManager();

manager.use(corsMiddleware({
  origin: '*',
  methods: ['GET', 'POST']
}));

manager.use(rateLimitMiddleware({
  limit: 100,
  window: 60000
}));

Geographic Routing

import { GeoRouter } from '@kalxjs/edge';

const router = new GeoRouter();

router.register('US', () => new Response('US content'));
router.register('EU', () => new Response('EU content'));
router.register('*', () => new Response('Default content'));

const response = await router.route(request);

Platform-Specific Features

Cloudflare Workers KV

import { WorkerKV } from '@kalxjs/edge/cloudflare';

const kv = new WorkerKV(env.MY_KV);
await kv.put('key', 'value', { expirationTtl: 3600 });
const value = await kv.get('key');

Cloudflare Durable Objects

import { DurableObjectWrapper } from '@kalxjs/edge/cloudflare';

const obj = new DurableObjectWrapper(env.MY_DO, id);
const result = await obj.call('method', arg1, arg2);

Deno KV

import { DenoKV } from '@kalxjs/edge/deno';

const kv = new DenoKV();
await kv.set(['users', 'alice'], { name: 'Alice' });
const user = await kv.get(['users', 'alice']);

Vercel KV

import { VercelKV } from '@kalxjs/edge/vercel';

const kv = new VercelKV();
await kv.set('key', 'value', { ex: 3600 });
const value = await kv.get('key');

API Reference

See PRIORITY_7_IMPLEMENTATION.md for complete API documentation.

Examples

License

MIT