OdatNurd

Terence Martin (OdatNurd)

Software Developer | YouTube / Twitch Content Creator

Contact Me

Categories

d1-query

import { dbFetch } from '@odatnurd/d1-query';

const result = await dbFetch(ctx.env.DB, 'get_users',
  `SELECT * FROM Users WHERE userId = :userId
                          OR username = :userName`,
  { userId: 69, userName: 'jim'}
)
v0.3.2

@odatnurd/d1-query is a lightweight utility wrapper designed to simplify interactions with Cloudflare D1 databases.

When building serverless applications on Cloudflare Workers, managing database connections and raw query execution can introduce repetitive boilerplate. This package streamlines the process of preparing statements, binding parameters, and handling the resulting data payloads, allowing you to focus directly on your application logic.

cf-requests

// Bring in the validation generator, the success response generator,
// and the route handler generator.
import {
  validate,
  success,
  routeHandler
} from '@odatnurd/cf-requests'
v0.1.16

@odatnurd/cf-requests is a simple request wrapper designed for Cloudflare Hono applications[cite: 2].

It helps reduce boilerplate when building API routes by providing a consistent wrapper for your endpoint handlers. This streamlines standardizing JSON responses, handling expected exceptions, and ensuring your route logic remains clean and focused solely on what the endpoint is supposed to do.

cf-aegis

export async function aegisSetup(ctx, inputConfig, {
  portAdjustment = 0,
  workerMocks = {},
  env = undefined
}) {
v0.1.10

@odatnurd/cf-aegis provides a collection of simple test helpers for Aegis- based environments[cite: 2].

Setting up robust testing environments for Cloudflare Workers can often require tedious mocking of environment variables, contexts, and bindings. This package provides straightforward scaffolding tools to make writing tests faster and more reliable, ensuring your testing suite remains maintainable as your project scales.