@byronwade/functions
v0.1.0
Published
Local function runner for Fakebase
Maintainers
Readme
@byronwade/functions
Part of Fakebase — a Supabase-shaped, local/dev-only development platform for Next.js prototypes. Not for production use.
A local function registry with Supabase-shaped invoke and RPC. Register handlers in-process and call them via invoke() / invokeRpc(), mirroring supabase.functions.
Installation
pnpm add @byronwade/functionsInstall this package directly to use the registry standalone.
Usage
import { FunctionRegistry } from "@byronwade/functions";
const functions = new FunctionRegistry();
functions.register({
name: "hello",
handler: (req) => ({ body: { message: "Hello!" } }),
});
const { data, error } = await functions.invoke("hello", { body: { name: "world" } });What's inside
FunctionRegistry—register,invoke(returns{ data, error }),invokeRpc,list,get.LocalEnv— a small local env-var helper (+ typeLocalEnvConfig).- Types:
FunctionDefinition,FunctionRequest,FunctionResponse,FunctionInvokeOptions,FunctionAuth.
Dev-only — handlers run in your local Node process, not an isolated edge runtime.
Documentation
License
MIT
