Skip to content

Instantly share code, notes, and snippets.

View mrbbot's full-sized avatar
🤖
Beep boop!

MrBBot mrbbot

🤖
Beep boop!
View GitHub Profile
@mrbbot
mrbbot / gc.mjs
Created November 17, 2023 12:24
Miniflare Garbage Collection Script
import fs from "node:fs";
import path from "node:path";
import { Miniflare, sanitisePath } from "miniflare";
async function main() {
// Extract and validate command line args
const argv = process.argv.slice(2);
if (argv.length < 2 || (argv[0] !== "kv" && argv[0] !== "cache")) {
console.log(`usage: node gc.mjs kv,cache [persist] [namespaces..]`);
process.exitCode = 1;
@mrbbot
mrbbot / api.d.ts
Last active October 16, 2022 10:05
JSG RTTI TypeScript Types (cloudflare/workerd#110)
/* eslint-disable */
// noinspection JSUnusedGlobalSymbols
// dom-exception
export declare class DOMException extends Error {
constructor(param0?: string, param1?: string);
readonly message: string;
readonly name: string;
readonly code: number;
readonly stack: any;
static readonly INDEX_SIZE_ERR: 1;