Skip to content

CodeDynasty-dev/Jetpath


Jetpath

Jetpath

Jetpath is the fast and minimalist framework for Node, Deno and Bun.

Explore Jetpath APIs »

Join Community . Report Bug . Request Feature

Contributors npm Version Forks Stargazers

Latest version info

In this version, we added/tested these features on all runtimes.

  1. auto-generated api documentation UI (Jetpath UI).
  2. file uploads
  3. support for websockets
  4. Jet Plugins.
  5. Robust schema validation
  6. Multi-runtime support
  7. Robust Context and body parser
  8. Security audits and fixes
  9. Robust error handling
  10. Robust logging
  11. Robust middleware
  12. Performance enhancements

In this version, multi-runtime support is no-longer based on compatibility but pure engine api(s).

  • more speed, same size, more power.

Syntax

// src/index.jet.js
import { type JetFunc, Jetpath, use } from "jetpath";

const app = new Jetpath({ APIdisplay: "HTTP" });

//? listening for requests
app.listen();

// this goes to = get /
export const GET_: JetFunc = async function (ctx) {
  ctx.send("hello world!");
};

// this goes to = post /
export const POST_: JetFunc = async function (ctx) {
  ctx.send( ctx.parse() );
};

// this goes to = post /api/v1/payments
export const POST_api_v1_payments: JetFunc = async function (ctx) {
    const { amount, currency, account } = ctx.parse();
    ctx.plugin.charge({ amount, currency, account });
    ctx.send({ success: true, message: "Payment successful" });
};

use(POST_api_v1_payments).body((t)=>{
 return {
    amount: t.number().required(),
    currency: t.string().required(),
    account: t.string().required()
 }   
})
.info("Charge a user's account");

Rationale - Docs

Jetpath is designed for high performance, security and ease of use, using convention over configuration method, jetpath ensure you spend less time on configuration and more time on the functionalities and concise organization of all your projects.

benchmark repo

  • Jetpath now runs on the runtime you are using, bun or node or deno.
  • Function names as routing patterns.
  • Middleware and error handler design.
  • Inbuilt Cors, body parser, websocket, cookies and logger handlers.
  • Inbuilt API auto doc functionality.
  • Fast, Small and easy as peasy - jetpath will make your projects shine.

--

Installation

Install Jetpath Right away on your project using npm or Javascript other package managers.

npm i jetpath --save

Apache 2.0 Licensed

Open sourced And Free.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the Apache 2.0 license. You are also implicitly verifying that all code are your original work. See our contributing guide

Support

Your contribution(s) is a good force for change anytime you do it, you can ensure Jetpath's continues growth and improvement by contributing a re-occurring or fixed donations to our Github sponsors.