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 🙏

© 2026 – Pkg Stats / Ryan Hefner

xirelta

v0.0.51

Published

A lightweight web framework for building web applications in TypeScript with Bun. It is designed to be flexible and easy to use, allowing you to create web services and applications with minimal effort.

Downloads

50

Readme

Xirelta Web Framework

Xirelta is a lightweight web framework for building web applications in TypeScript with Bun. It is designed to be flexible and easy to use, allowing you to create web services and applications with minimal effort.

Installation

You can install Xirelta using Bun:

bun add xirelta

Getting Started

To get started with Xirelta, you need to create an instance of the Application class and define your routes and handlers. Here's a basic example:

import { Application } from 'xirelta';

const app = new Application();

app.get('/', (request) => {
  return 'Hello, Xirelta!';
});

app.start().then((serverInfo) => {
  console.log(`Server is running on port ${serverInfo.port}`);
});

In this example, we create a simple web server that listens on the root path and responds with "Hello, Xirelta!" when accessed.

Defining Routes

You can define routes for various HTTP methods using the following methods:

  • app.all(path, handler): Matches all HTTP methods.
  • app.get(path, handler): Matches GET requests.
  • app.post(path, handler): Matches POST requests.
  • app.put(path, handler): Matches PUT requests.
  • app.delete(path, handler): Matches DELETE requests.

The path parameter is a string that defines the URL pattern for the route, and the handler parameter is a function that handles the incoming requests and returns a response.

Handling Requests

The handler function takes a request object as its parameter, which contains information about the incoming request. You can access parameters, query strings, request bodies, and more from this object.

Here's an example of handling a GET request with a parameter:

app.get('/user/:id', (request) => {
  const userId = request.params.id;
  // Retrieve user data based on the userId
  const user = getUserById(userId);
  if (!user) {
    return new Response('User not found', { status: 404 });
  }
  return user;
});

In this example, we define a route with a parameter :id in the URL pattern. We then access this parameter using request.params.id and use it to retrieve user data.

Custom Responses

You can return custom responses using the Response class or plain JSON objects. Xirelta will handle serializing these responses appropriately.

app.get('/json', (request) => {
  return {
    message: 'This is a JSON response',
  };
});

app.get('/custom-response', (request) => {
  return new Response('Custom Response', { status: 200, headers: { 'Content-Type': 'text/plain' } });
});

Starting and Stopping the Server

To start the Xirelta web server, call the start method on your Application instance. It returns a promise that resolves with information about the server, including the port it's listening on.

app.start().then((serverInfo) => {
  console.log(`Server is running on port ${serverInfo.port}`);
});

To stop the server, use the stop method:

app.stop().then(() => {
  console.log('Server has stopped');
});

Configuration

Xirelta allows you to configure various options for your application, including the web server's port and logging. You can pass a configuration object when creating an Application instance:

const config = {
  web: {
    port: 8080, // Set the port to 8080
  },
  logger: {
    debug(message, options) {
      console.debug(message, options);
    },
    info(message, options) {
      console.info(message, options);
    },
  },
};

const app = new Application(config);

License

MIT