
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@kagchi/fasting
Advanced tools
pnpm add @kagchi/fasting
npm i @kagchi/fasting
yarn add @kagchi/fasting
src/index.ts
import { fasting } from "@kagchi/fasting";
import fastify from "fastify";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const fastifyApp = fastify({
logger: true
});
await fastifyApp.register(fasting, {
basePath: resolve(dirname(fileURLToPath(import.meta.url)))
});
await fastifyApp.listen({ port: 3_000 })
.then(() => console.log("Server is running on port 3000"))
.catch(() => console.log("Server failed to start"));
src/routes/index.ts
import type { RouteOptions } from "@kagchi/fasting";
import { Route } from "@kagchi/fasting";
import type { LoaderPieceContext } from "@sapphire/pieces";
import type { FastifyReply, FastifyRequest } from "fastify";
export class Root extends Route {
public constructor(context: LoaderPieceContext, options: RouteOptions) {
super(context, {
...options,
method: "GET",
path: "/"
});
}
public run(request: FastifyRequest, response: FastifyReply): FastifyReply {
return response.send("Hello, world!");
}
}
FAQs
A Better Fastify auto loads for Routes & Prehandlers
The npm package @kagchi/fasting receives a total of 20 weekly downloads. As such, @kagchi/fasting popularity was classified as not popular.
We found that @kagchi/fasting demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.