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

yaf-framework

v1.0.9

Published

> A lightweight, zero-dependency Node.js web framework for modern applications

Readme

YAF Framework

A lightweight, zero-dependency Node.js web framework for modern applications

[NPM Version [Node Version [License: ISC

Overview

YAF (Yet Another Framework) is a modern, lightweight Node.js framework designed for building scalable web applications. It provides a robust foundation with essential features while maintaining simplicity and performance.

Key Features

  • High-Performance Routing: Trie-based routing system for efficient request handling
  • Middleware Architecture: Flexible middleware system with global, route-specific, and error-handling support
  • Built-in Security: CORS middleware with comprehensive configuration options
  • Database Integration: Transactional in-memory database for rapid prototyping
  • Modern JavaScript Support: Built for Node.js ≥14.0.0
  • Type Safety: Well-structured codebase with type definitions
  • Modular Design: Support for nested routers and route grouping
  • Request Processing: Advanced body parsing and query parameter handling

Installation

npm install yaf-framework

Quick Start

const { Yaf, run } = require('yaf-framework');
const bodyParser = require('yaf-framework/body-parser');
const cors = require('yaf-framework/cors');

const app = new Yaf();

// Middleware configuration
app.use(cors());
app.use(bodyParser());

// Route handlers
app.get('/api', (req, res) => {
  res.json({ status: 'API is running' });
});

// Start server
run(app, 3000, () => {
  console.log('Server running on http://localhost:3000');
});

Core Components

Router Module

const { Yaf } = require('yaf-framework');
const router = new Yaf();

// Route definition
router.get('/users/:id', (req, res) => {
  res.json({ userId: req.params.id });
});

// Middleware attachment
router.use('/admin', authMiddleware);

Database Operations

const { InMemoryDatabase } = require('yaf-framework/database');
const db = new InMemoryDatabase();

// Transaction management
const txId = db.beginTransaction();
try {
  db.set('user:1', { name: 'John' });
  db.commitTransaction(txId);
} catch (error) {
  db.rollbackTransaction(txId);
}

CORS Configuration

const cors = require('yaf-framework/cors');

app.use(cors({
  origin: ['https://example.com'],
  methods: ['GET', 'POST'],
  credentials: true
}));

API Reference

Router Methods

  • router.get(path, ...handlers)
  • router.post(path, ...handlers)
  • router.put(path, ...handlers)
  • router.delete(path, ...handlers)
  • router.use(middleware)
  • router.group(prefix, middleware, callback)

Database Methods

  • db.set(key, value)
  • db.get(key)
  • db.delete(key)
  • db.beginTransaction()
  • db.commitTransaction(id)
  • db.rollbackTransaction(id)

Response Methods

  • res.status(code)
  • res.json(data)
  • res.send(data)

Configuration Options

Body Parser

app.use(bodyParser({
  limit: '1mb',
  strict: true,
  type: 'application/json'
}));

CORS Options

{
  origin: '*',
  methods: ['GET', 'POST', 'PUT', 'DELETE'],
  allowedHeaders: ['Content-Type', 'Authorization'],
  credentials: false,
  exposedHeaders: []
}

Requirements

  • Node.js ≥ 14.0.0
  • NPM or Yarn package manager

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the ISC License - see the LICENSE file for details.

Author

Veli Furkan TÜRKOĞLU

Links