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

@elv1bro/beanorm

v1.3.2

Published

Lightweight ORM for Node.js with automatic table creation and CRUD operations

Readme

BeanORM

BeanORM is a lightweight ORM library for Node.js, similar to RedBeanPHP, with automatic table and field creation, full CRUD support, relationships, and versatility.

Installation

npm install eredbean

Supported Databases

  • MySQL
  • PostgreSQL
  • SQLite

Usage Example

import Bean from '@elv1bro/beanorm';

// MySQL/PostgreSQL
const mysqlConfig = {
  type: 'mysql',
  host: 'localhost',
  user: 'username',
  password: 'password',
  database: 'mydb'
};

// SQLite
const sqliteConfig = {
  type: 'sqlite',
  filename: './database.sqlite'
};

const user = new Bean('user', sqliteConfig);
user.set('name', 'Alice');
user.set('email', '[email protected]');
await user.save();

const user2 = await Bean.load('user', user._id);
user2.set('name', 'Alice Smith');
await user2.save();

await user2.delete();

🤖 AI Assistant Instructions

Project Metadata

We've prepared an automatically generated file PROJECT_METHODS.json with detailed information about methods and project structure.

How to Use Metadata

  1. Examine the PROJECT_METHODS.json file in the project root
  2. Pay attention to class methods:
    • BaseModel: Basic model operations
    • Bean: Main ORM class
    • Repository: Data repository management
    • TableMetadataCache: Table metadata caching
# Quick metadata view
cat PROJECT_METHODS.json

Generating Metadata

To update metadata, use the command:

npm run generate-ai-metadata

Key Classes and Their Methods

BaseModel

  • constructor(): Model initialization
  • set(): Setting field values
  • save(): Saving the model
  • delete(): Deleting the model
  • Static methods load() and find()

Bean

  • Extends BaseModel
  • Additional methods hasOne() and hasMany() for relationships
  • Support for working with different database adapters (MySQL, PostgreSQL, SQLite)

Repository

  • Low-level data operations
  • Methods create(), findById(), find(), deleteById()
  • Raw SQL query support

TableMetadataCache

  • Table structure caching
  • Methods getTableStructure(), setTableStructure()
  • Performance optimization

Code Study Recommendations

  • Start with Bean.js - the ORM's central class
  • Study BaseModel.js to understand basic logic
  • Analyze adapters in src/adapters/
  • Look at examples in the use/ directory

License

MIT License