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 🙏

© 2024 – Pkg Stats / Ryan Hefner

blini

v0.0.0

Published

Modern MongoDB ORM backed by immutable models

Downloads

6

Readme

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.

Example

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)
    })

Why?

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.

Principles

Blini tries to solve the question of "Why?" with a few principles:

  1. 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.

  2. Simplicity: Blini tries to reduce the number of concepts and provide a unified API (it doesn't support callback, etc).

  3. Composition: Instead of relying on a custom plugins logic to handle extensibility, it uses ES6 classes inheritances and compositions to extend models behavior.

  4. Intuitive Data Structure: By using Immutable.js iterable data structure (List, Map and Set), it makes easier to manipulate document.

Documentation

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.

Contributing!

All contributions are super welcome!

Blini is Apache-licensed.