@vyriy/smoke
Part of Vyriy - a calm architecture toolkit for TypeScript, React, SSR, SSG, APIs, and cloud-ready apps.
Smoke request matcher for Vyriy projects.
Purpose
This package provides a small helper for recognizing a dedicated smoke request and returning a predefined response without running the main handler logic.
It is intended to be used directly or through packages such as @vyriy/handler.
Install
With npm:
npm install @vyriy/smoke
With Yarn:
yarn add @vyriy/smoke
Usage
Use the default smoke request and response:
import { smoke } from '@vyriy/smoke';
const result = smoke({ isSmoke: true });
if (result) {
return result;
}
API
requestDefault smoke request payload:{ isSmoke: true }.responseDefault API Gateway-compatible smoke response:
{
statusCode: 200,
body: JSON.stringify({
status: 'success',
}),
}
smoke(event)Returns the smoke response wheneventmatches the smoke request, otherwise returnsfalse.
Notes
- matching checks whether the incoming event is an object with
isSmoke: true - the helper is best suited for small, stable smoke payloads