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

apiato

v3.1.2

Published

An amazing and easy to use CRUD API-REST/SOCKETIO constructors for API with mongoDB(mongoose) and SQL(sequelize)

Readme

Apiato.js

A powerful and flexible API library for Node.js that supports both SQL (Sequelize) and NoSQL (Mongoose) databases, with REST and Socket.IO implementations.

Features

  • Support for both SQL (Sequelize) and NoSQL (Mongoose) databases
  • REST API implementation
  • Socket.IO implementation
  • TypeScript support
  • Validation
  • Pagination
  • Sorting
  • Filtering
  • Population/Include relations
  • Room-based communication (Socket.IO)
  • Broadcasting (Socket.IO)

Installation

bun install apiato

Examples

This repository includes four example implementations:

  1. REST API with Sequelize (SQLite)
  2. REST API with Mongoose (MongoDB)
  3. Socket.IO with Sequelize (SQLite)
  4. Socket.IO with Mongoose (MongoDB)

Running the Examples

Each example is in its own directory under examples/. To run an example:

  1. Navigate to the example directory:
cd examples/[example-name]
  1. Install dependencies:
bun install
  1. Start the development server:
bun run dev

Example Ports

  • Sequelize REST API: http://localhost:3000
  • Mongoose REST API: http://localhost:3001
  • Mongoose Socket.IO: http://localhost:3002
  • Sequelize Socket.IO: http://localhost:3003

Usage

REST API with Sequelize

import { ApiatoSQL } from 'apiato/typescript';
import User from './models/User';

const apiato = new ApiatoSQL();

// Create routes
router.post('/', apiato.createOne(User));
router.get('/', apiato.getMany(User));
router.get('/:id', apiato.getOneById(User));
router.put('/:id', apiato.updateById(User));
router.delete('/:id', apiato.findIdAndDelete(User));

REST API with Mongoose

import { ApiatoNoSQL } from 'apiato/typescript';
import User from './models/User';

const apiato = new ApiatoNoSQL();

// Create routes
router.post('/', apiato.createOne(User));
router.get('/', apiato.getMany(User));
router.get('/:id', apiato.getOneById(User));
router.put('/:id', apiato.updateById(User));
router.delete('/:id', apiato.findIdAndDelete(User));

Socket.IO with Sequelize/Mongoose

import { ApiatoSocket } from 'apiato/typescript';
import { Server } from 'socket.io';
import User from './models/User';

const io = new Server(httpServer);
const userSocket = new ApiatoSocket(io, User);

// Available events:
// - create
// - getMany
// - getOneById
// - updateById
// - deleteById

// Example client usage:
socket.emit('create', JSON.stringify({
    body: {
        name: "John Doe",
        email: "[email protected]",
        age: 30
    },
    responseType: "private" // or "broadcast" or "room"
}));

API Documentation

REST API Endpoints

  • POST /: Create a new record
  • GET /: Get all records (with pagination, sorting, filtering)
  • GET /:id: Get a record by ID
  • PUT /:id: Update a record by ID
  • DELETE /:id: Delete a record by ID

Socket.IO Events

  • create: Create a new record
  • getMany: Get all records
  • getOneById: Get a record by ID
  • updateById: Update a record by ID
  • deleteById: Delete a record by ID

Query Parameters (REST API)

  • where: Filter records by field values
  • like: Filter records using partial matches
  • select: Select specific fields
  • paginate: Paginate results (page, limit)
  • sort: Sort results by fields
  • populate/include: Include related records

Socket.IO Request Format

{
    body?: any;              // Data for create/update operations
    id?: number | string;    // Record ID for single-record operations
    query?: {                // Query parameters
        where?: any;         // Filter conditions
        attributes?: string[]; // Fields to select (Sequelize)
        select?: any;        // Fields to select (Mongoose)
        include?: any[];     // Relations to include
        sort?: any;          // Sort conditions
        paginate?: {         // Pagination
            page: number;
            limit: number;
        }
    };
    responseType?: 'private' | 'broadcast' | 'room'; // Response type
    room?: string;           // Room name for room-based responses
    tag?: string;            // Custom tag for response tracking
}

License

MIT