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

aroma.js

v1.1.5

Published

A lightweight, feature-rich, and developer-friendly web framework to build modern applications with ease.

Readme

Aroma.js is a lightweight, feature-rich, and developer-friendly web framework designed to build modern web applications with ease. It provides essential features like routing, middleware, session management, cookie handling, template rendering, static file serving, and more. With its simple API, it enables rapid development of web applications with flexibility.

Website

For more information, visit the official website of Aroma.js: https://aroma.js.org

Table of Contents

Features

  • Routing: Simple and flexible routing system.
  • Router: Modular routing with support for sub-routers
  • Middleware: Easily add custom logic between requests and responses.
  • Sessions: Manage user sessions with customizable session IDs.
  • Cookies: Parse and manage cookies with ease.
  • Static File Serving: Serve static files such as HTML, CSS, JS, images, etc.
  • Template Engine: Render dynamic content using custom templates.
  • Rate Limiting: Add rate limiting to prevent abuse.
  • Logging: Built-in logging support.
  • Error Handling: Custom error handling for a better user experience.

Installation

NPM Installation

To install Aroma.js via npm, run the following command in your project directory:

npm install aroma.js

GitHub Installation

Alternatively, you can clone the repository from GitHub:

git clone https://github.com/aaveshdev/aroma.js.git

Navigate to the aroma.js directory and install dependencies:

cd aroma.js
npm install

Basic Usage

Here is a basic example to get started with Aroma.js:

import Aroma from "aroma.js";

const app = new Aroma();

// Middleware example
app.use((req, res, next) => {
  console.log(`Request received: ${req.method} ${req.url}`);
  next();
});

// Simple route
app.get("/", (req, res) => {
  res.send({ message: "Hello, world!" });
});

// Start server
app.listen(3000, () => {
  console.log("Aroma.js server running on http://localhost:3000");
});

API Documentation

Routes

Define HTTP methods for handling routes.

app.get("/path", handler); // GET request
app.post("/path", handler); // POST request
app.put("/path", handler); // PUT request
app.delete("/path", handler); // DELETE request

Router

Aroma.js provides a Router class for modular routing. You can define routes in a separate file and mount them onto the main application.

Create a Router

import { Router } from "aroma.js";

const router = new Router();

router.get("/", (req, res) => {
  res.send({ message: "Hello from Router!" });
});

router.get("/:id", (req, res) => {
  res.send({ message: `User ID: ${req.params.id}` });
});

export default router;

Mount the Router

import Aroma from "aroma.js";
import userRouter from "./routes/user";

const app = new Aroma();

// Mount the router under /users
app.use("/users", userRouter);

app.listen(3000, () => {
  console.log("Server is running on http://localhost:3000");
});

Middleware

You can use custom middleware to process requests before they reach the route handlers.

app.use((req, res, next) => {
  // Custom logic
  next();
});

Sessions

Enable session management with cookies:

app.useSessions();

Sessions are automatically handled, and session data is stored in memory.

Cookies

Manage cookies:

app.manageCookies(res, "cookieName", "cookieValue", {
  httpOnly: true,
  maxAge: 3600,
});

Template Engine

Enable the template engine to render dynamic views:

app.enableTemplateEngine();
app.render(res, "view", { data: "value" });

Error Handling

Handle errors with custom error handlers:

app.handleErrors((err, req, res) => {
  res.status(500).send("Internal Server Error");
});

Example

Here is an example of using Aroma.js to create a basic application with routes, middleware, and static file serving:

import Aroma from "aroma.js";

const app = new Aroma();

// Serve static files from 'public' directory
app.serveStatic("public");

// Middleware to log requests
app.use((req, res, next) => {
  console.log(`Received ${req.method} request to ${req.path}`);
  next();
});

// Simple route to handle GET requests to the root
app.get("/", (req, res) => {
  res.send({ message: "Welcome to Aroma.js!" });
});

// Handle errors globally
app.handleErrors((err, req, res) => {
  console.error(err);
  res.send(JSON.stringify({ error: "Internal Server Error" }));
});

// Start the server
app.listen(3000, () => {
  console.log("Aroma.js server running at http://localhost:3000");
});

Support My Work

Aroma.js is an open-source project built with passion to provide developers with a fast and lightweight web framework. If you find this project useful and want to support its continuous development, consider buying me a coffee! ☕

Your support helps in adding new features, improving performance, and maintaining the project. Every contribution is greatly appreciated!

Buy Me a Coffee