# redbean-node

> RedBeanNode is an easy to use ORM tool for Node.js, strongly inspired by RedBeanPHP. It automatically generates the tables and columns on-the-fly

Latest version **0.4.0** (published 2026-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install redbean-node
pnpm add redbean-node
yarn add redbean-node
bun add redbean-node
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2026-09-23 |
| First published | 2020-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 229.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | Louis Lam |
| Maintainers | louislam |
| Keywords | redbeanphp, orm, sql, mysql, mariadb, sqlite, query, knex, bean, redbean, redbean-node, redbeannode |

## Links

- npm: https://www.npmjs.com/package/redbean-node
- Repository: https://github.com/louislam/redbean-node
- Homepage: https://github.com/louislam/redbean-node#readme
- Issues: https://github.com/louislam/redbean-node/issues
- npm.io page: https://npm.io/package/redbean-node

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ~13.0.6
- [knex](https://npm.io/package/knex.md) ~3.3.0
- [dayjs](https://npm.io/package/dayjs.md) ~1.11.23
- [await-lock](https://npm.io/package/await-lock.md) ~2.2.2
- [@types/node](https://npm.io/package/@types/node.md) ~26.6.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2026-09-23
- 0.0.11-0 (alpha) — 2020-10-26
- 0.3.3 — 2023-11-18
- 0.3.2 — 2023-11-10
- 0.3.1 — 2023-07-27
- 0.3.0 — 2023-06-25
- 0.2.0 — 2023-01-14
- 0.1.4 — 2022-04-12
- 0.1.3 — 2021-10-29
- 0.1.2 — 2021-08-31
- 0.1.1 — 2021-08-23
- 0.1.0 — 2021-08-23
- 0.0.21 — 2021-08-05
- 0.0.20 — 2021-04-09
- 0.0.19 — 2020-10-31
- … 18 more at https://npm.io/package/redbean-node/versions

## README

# RedBeanNode

[![npm](https://img.shields.io/npm/dt/redbean-node)](https://www.npmjs.com/package/redbean-node)
[![pipeline status](https://img.shields.io/gitlab/pipeline/louislam/redbean-node/master?label=build)](https://gitlab.com/louislam/redbean-node/-/commits/master) 
[![Coverage Status](https://img.shields.io/coveralls/github/louislam/redbean-node)](https://coveralls.io/github/louislam/redbean-node?branch=master) 
[![npm](https://img.shields.io/npm/v/redbean-node)](https://www.npmjs.com/package/redbean-node) 


### ⚠️Warning: Early Development. Do not use it on production!

RedBeanNode is an easy to use **ORM** tool for Node.js, strongly inspired by RedBeanPHP. 

* **Automatically** creates **tables** and **columns** as you go
* No configuration, just fire and forget
* Ported RedBeanPHP's main features and api design
* Build on top of knex.js
* Supports **JavaScript** & **TypeScript**
* **async/await** or **promise** friendly

## Supported Databases

* MySQL / MariaDB
* SQLite

## Installation

```shell script
npm install redbean-node --save
```

## Read More

Docs:
http://redbean-node.whatsticker.online

## Playground

Try RedBeanNode in browser!

https://runkit.com/louislam/redbeannode-playground

## Code Example

This is how you do CRUD in RedBeanNode:

```javascript
const {R} = require("redbean-node");

// Setup connection
R.setup();

(async () => {
    let post = R.dispense('post');
    post.text = 'Hello World';

    // create or update
    let id = await R.store(post);

    // retrieve
    post = await R.load('post', id);

    console.log(post);

    // delete
    await R.trash(post);

    // close connection
    await R.close();
})();

```

This **automatically generates** the tables and columns... on-the-fly. It infers relations based on naming conventions.

# Unit Test

Please build the project before run the test.


# Additional 

Icons made by <a href="https://www.flaticon.com/authors/vitaly-gorbachev" title="Vitaly Gorbachev">Vitaly Gorbachev</a> from https://www.flaticon.com

---
_Source: https://npm.io/package/redbean-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
