npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@craftsjs/fast-server

v0.0.1

Published

An express-like API for bun http server

Downloads

3

Readme

fastServer: The Ultra-Fast Bun Router Web Framework

Welcome to fastServer — a groundbreaking web framework for bun. Engineered for performance, it operates at speeds 6 times faster than the renowned Express.js. With fastServer, you don't have to compromise on speed or ease of use; you get both.

Features

  • 🚄 Blazing Fast Performance: Experience speeds that are 6x faster than Express.js. Ensure your web applications run lightning-quick with fastServer.

  • 🛠 Intuitive API: Familiar with Express.js? Transitioning to fastServer is a breeze thanks to our similar API design.

  • 📦 Flexibility and Extensibility: Incorporate middleware, define custom routes, and further expand your application as needed.

  • 🔒 Robust Error Handling: Benefit from our built-in error handling mechanisms to ensure application stability.

Quick Start

const app = fastServer();

app.get('/', (req, res) => {
    res.send('hello world');
});

app.server();

🛣 Routing

Manage your application's endpoints seamlessly:

// Handling a GET request
app.get('/example', (req, res) => {
    res.send('This is a GET request');
});

// Handling a POST request
app.post('/example', (req, res) => {
    res.send('This is a POST request');
});

📦 fastServer.Router

Modularize and organize your routes with fastServer.Router:

const router = app.router();

router.get('/', (req, res) => {
    res.send('Router home page');
});

router.get('/about', (req, res) => {
    res.send('About page via router');
});

export default router;

Then, seamlessly integrate the router into your main application:

import * as myRoutes from './myRoutesFile';

app.use('/prefix', myRoutes);

🖥 Middlewares

Integrate middleware functions with ease:

const loggerMiddleware = (req, res, next) => {
    console.log('Logged at:', Date.now());
    next();
};

app.use(loggerMiddleware);

❗ Error Handling

Handle errors gracefully and respond aptly:

app.use((req, res, err, next) => {
    console.error(err?.message);
    res.status(500).send('Oops! Something went wrong.');
});

💡 Why fastServer?

In today's digital age, performance is crucial. Every millisecond saved can lead to better user experience and engagement. fastServer doesn't just offer rapid response times but is designed to handle a myriad of requests efficiently. Whether you're developing a small app or a large-scale system, fastServer has your back.