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

@cribops/astro

v0.1.1

Published

Deploy Astro sites to AWS with CribOps - S3, CloudFront, Lambda SSR, and Hive caching

Downloads

16

Readme

@cribops/astro

Deploy Astro sites to AWS with CribOps — S3, CloudFront, Lambda SSR, and Hive caching.

npm version License: MIT

Early Development — This adapter is under active development. API may change. Not yet recommended for production use.

Features

  • Three deployment tiers: Starter (SSG), Pro (Hybrid), Scale (Full SSR)
  • AWS-native: S3 + CloudFront CDN with Lambda@Edge SSR
  • Hive caching: Sub-millisecond Redis-compatible caching
  • WordPress integration: Headless CMS with intelligent cache invalidation
  • Streaming SSR: Progressive HTML rendering for faster TTFB
  • Multi-region: Deploy to multiple AWS regions for global performance

Installation

npm install @cribops/astro

Quick Start

// astro.config.mjs
import { defineConfig } from 'astro/config';
import cribops from '@cribops/astro';

export default defineConfig({
  output: 'hybrid', // or 'server' for full SSR
  adapter: cribops({
    tier: 'pro', // 'starter' | 'pro' | 'scale'
    region: 'us-east-1',
  }),
});

Deployment Tiers

Starter (Static)

Pure static site generation — fastest and cheapest.

adapter: cribops({
  tier: 'starter',
})
  • ✅ S3 + CloudFront CDN
  • ✅ Custom domains with SSL
  • ✅ GitHub auto-deploy
  • ❌ No SSR routes

Pro (Hybrid)

Static pages with on-demand SSR for dynamic routes.

adapter: cribops({
  tier: 'pro',
  hive: {
    enabled: true,
    defaultTTL: 3600,
  },
})
  • ✅ Everything in Starter
  • ✅ Lambda SSR for dynamic routes
  • ✅ Hive caching
  • ✅ Session management

Scale (Full SSR)

All routes rendered on-demand with full infrastructure.

adapter: cribops({
  tier: 'scale',
  regions: ['us-east-1', 'eu-west-1'],
  lambda: {
    memory: 2048,
    streaming: true,
  },
})
  • ✅ Everything in Pro
  • ✅ Multi-region deployment
  • ✅ Aurora database access
  • ✅ Streaming SSR

Using Hive Cache

Hive is CribOps's Redis-compatible caching layer with sub-millisecond latency.

Basic Usage

---
// src/pages/blog/[slug].astro
import { hive } from '@cribops/astro/hive';

export const prerender = false;

const { slug } = Astro.params;

// Get or set cached content
const post = await hive.getOrSet(
  `post:${slug}`,
  async () => {
    const res = await fetch(`https://api.example.com/posts/${slug}`);
    return res.json();
  },
  { ttl: 3600, tags: ['posts', `post:${slug}`] }
);
---

<article>
  <h1>{post.title}</h1>
  <div set:html={post.content} />
</article>

Cache Invalidation

import { hive } from '@cribops/astro/hive';

// Invalidate by tag
await hive.invalidateTag('posts');

// Invalidate by pattern
await hive.invalidatePattern('post:*');

// Publish invalidation event
await hive.publish('cache:invalidate', { pattern: 'post:*' });

Middleware

Cache Middleware

Automatically cache SSR pages in Hive:

// src/middleware.ts
import { sequence } from 'astro:middleware';
import { createCacheMiddleware } from '@cribops/astro/middleware';

const cache = createCacheMiddleware({
  defaultTTL: 3600,
  excludePatterns: ['/api/*', '/admin/*'],
  staleWhileRevalidate: true,
});

export const onRequest = sequence(cache);

Control caching per-page with headers:

---
// Cache this page for 1 hour
Astro.response.headers.set('X-Cache-TTL', '3600');
---

Session Middleware

Manage user sessions via Hive:

// src/middleware.ts
import { sequence } from 'astro:middleware';
import { createSessionMiddleware } from '@cribops/astro/middleware';

const session = createSessionMiddleware({
  cookieName: 'session',
  ttl: 86400, // 24 hours
});

export const onRequest = sequence(session);

Access sessions in pages:

---
// Get session data
const user = Astro.locals.session?.get('user');

// Set session data
Astro.locals.session?.set('cart', { items: [] });
---

WordPress Integration

Use Astro as a headless frontend for WordPress:

// astro.config.mjs
adapter: cribops({
  tier: 'pro',
  wordpress: {
    url: 'https://wp.mysite.com',
    cache: true,
    cacheTTL: 300,
  },
})
---
// src/pages/blog/[slug].astro
import { hive } from '@cribops/astro/hive';

const { slug } = Astro.params;
const wpUrl = import.meta.env.WORDPRESS_URL;

const post = await hive.getOrSet(
  `wp:post:${slug}`,
  async () => {
    const res = await fetch(`${wpUrl}/wp-json/wp/v2/posts?slug=${slug}`);
    const posts = await res.json();
    return posts[0];
  },
  { ttl: 300, tags: ['wordpress', 'wp:posts'] }
);
---

Configuration Reference

interface CribopsAdapterOptions {
  // Deployment tier
  tier?: 'starter' | 'pro' | 'scale';

  // AWS region
  region?: string;

  // Multi-region deployment (scale tier only)
  regions?: string[];

  // Lambda configuration
  lambda?: {
    memory?: number;      // MB (128-10240)
    timeout?: number;     // seconds (1-900)
    architecture?: 'arm64' | 'x86_64';
    streaming?: boolean;
  };

  // Hive cache configuration
  hive?: {
    enabled?: boolean;
    host?: string;
    port?: number;
    database?: number;
    defaultTTL?: number;
  };

  // WordPress integration
  wordpress?: {
    url?: string;
    cache?: boolean;
    cacheTTL?: number;
  };
}

Environment Variables

| Variable | Description | |----------|-------------| | HIVE_HOST | Hive server hostname | | HIVE_PORT | Hive server port (default: 6379) | | HIVE_DATABASE | Hive database number | | HIVE_PASSWORD | Hive authentication password | | CRIBOPS_SITE_ID | Site ID for key prefixing | | WORDPRESS_URL | WordPress REST API URL |

Deployment

Via CribOps Platform

  1. Connect your GitHub repository in the CribOps dashboard
  2. Select your deployment tier
  3. Push to deploy

Manual Deployment

# Build your site
npm run build

# The build outputs:
# - dist/client/  → Upload to S3
# - dist/server/  → Deploy to Lambda
# - dist/cribops-manifest.json → Provisioning config

Comparison with Cloudflare

| Feature | Cloudflare | CribOps | |---------|------------|---------| | KV Store | Workers KV (60s consistency) | Hive (<1ms, strong consistency) | | Database | D1 (SQLite) | Aurora (PostgreSQL/MySQL) | | Storage | R2 | S3 | | Edge Compute | Workers | Lambda@Edge | | Sessions | KV-based | Hive (Redis-compatible) |

License

MIT © CloudBedrock