Lyn is:
- Fast
- Type-safe
- Secure with built-in authentication
- Runs everywhere
Lyn isn't here to replace existing frameworks. It was born from the need for a simple way to build things faster, with the best quality and developer experience.
Most frameworks serve as a foundation for your products. However, I often need something simpler with authentication and security built-in by default.
That's why Lyn focuses on being the easiest tool for POCs, solopreneurs, and agencies.
Lyn leverages Bun and the best JavaScript libraries for the job.
new Lyn()
.get("/text", () => {
return "Hello World";
})
.get("/json", () => {
return {
message: "Hello World",
};
})
.get(
"/:name",
({ params }) => {
return {
message: "Hello " + params.name,
};
},
{
params: z.object({
name: z.string(),
}),
}
)
.post("/", ({ set }) => {
set.status = 201;
return {
message: "Hello World",
};
})
.post(
"/users",
({ body, set }) => {
set.status = 201;
return {
message: "Hello " + body.name,
};
},
{
body: z.object({
name: z.string(),
}),
}
)
.listen(3000);- Register Routes
- Request lifecycle
- Body validation
- Params validation
- Search params validation
- Optimize the request lifecycle with ghost objects
- Add a logger
- Do a Security Checklist
MIT