
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
blini
is a modern ORM for MongoDB based on immutable data structure and promises.
Blini is currently in alpha. API may changed, don't use it for production applications.
import { Schema, Type, Model, Connection } from 'blini'
const connection = new Connection('mongodb://localhost/test')
const postSchema = new Schema({
title: Type.String(),
views: Type.Set(Type.String)
})
class Post extends Model(postSchema, connection, 'Cat') {
get summary() {
return `Post ${this.title}, ${this.likes.size} readers`
}
addView(ip) {
const { views } = this;
return this.merge({
views: views.add(ip)
})
}
}
const post = new Post({ title: 'My Super blog post' })
post.addView('127.0.0.1').save()
.then(function(savedPost) {
console.log(savedPost.summary)
})
First of all, this library is a Work-In-Progress and Proof-Of-Concept.
Before creating Blini, I've used a lot Mongoose for production applications, Blini borrowed a few concepts from it.
Blini tries to solve the question of "Why?" with a few principles:
Immutable data: By using Immutable.js, the Blini is built in a stateless fashion using immutable data structures, which leads to much easier to reason about code, and a much easier time working with data sets.
Simplicity: Blini tries to reduce the number of concepts and provide a unified API (it doesn't support callback, etc).
Composition: Instead of relying on a custom plugins logic to handle extensibility, it uses ES6 classes inheritances and compositions to extend models behavior.
Intuitive Data Structure: By using Immutable.js iterable data structure (List
, Map
and Set
), it makes easier to manipulate document.
If you're using Blini for the first time, check out the Getting Started guides and the Core Concepts to familiarize yourself with Blini's architecture and mental models. Once you've gotten familiar with those, you'll probably want to check out the full API Reference.
All contributions are super welcome!
Blini is Apache-licensed.
FAQs
Modern MongoDB ORM backed by immutable models
The npm package blini receives a total of 2 weekly downloads. As such, blini popularity was classified as not popular.
We found that blini demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.