bust-kv-cache.mjs

_scripts/bust-kv-cache.mjs
#!/usr/bin/env node
// Bust the KV cache for likes/shares. Next read per post will rehydrate
// from Postgres.
//
// Usage:
// npm run bust:kv # wipe all posts
// npm run bust:kv -- --posts=12,34 # wipe specific post IDs
// npm run bust:kv -- --dry-run # preview without deleting
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import { createClient } from '@vercel/kv'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const ROOT_DIR = path.resolve(__dirname, '..')
function loadEnvFile(file) {

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC