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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jsondb-sequelize-like

v0.4.2

Published

⚠️ Note: This project is not affiliated with Sequelize. It’s simply inspired by its syntax and modeling philosophy to make transitions easier.

Readme

jsondb-sequelize-like – A lightweight JSON-based database with Sequelize-like syntax

⚠️ Note: This project is not affiliated with Sequelize. It’s simply inspired by its syntax and modeling philosophy to make transitions easier.

Documentation availables in docs folder

jsondb-sequelize-like is a minimalist, file-based JSON database engine inspired by Sequelize.
It stores your data in flat .json files, supports typed schemas, append-only logs, validation, and a syntax similar to popular ORMs.
Ideal for embedded systems, CLIs, quick prototyping, or educational use.


🚀 Features

  • 💾 Flat-file JSON storage
  • 🧠 In-memory cache with periodic snapshot (fast processing in history and cache, slow process of storing trigger periodically)
  • ✍️ Append-only sync history for safe writes (concurrency-free)
  • 🔍 SQL-like querying: where, like, is, etc.
  • 🧱 Schema definition with DataTypes, unique, validation, etc.
  • 🎯 Auto-incrementing primary keys
  • 🗓️ Auto save createdAt and updatedAt
  • ✅ Inspired by Sequelize syntax
  • 🔒 No external dependencies

Watch our Sequelize Compatibility file for more information or compatibiliy check.

All syntax should be the same as sequelize v6, so you can refer to their documentation to use this package.


📦 Installation

npm install jsondb-sequelize-like

🛠️ Basic Usage

1. Define a model

import Jdb, { DataTypes } from 'jsondb-sequelize-like';

const db = new Jdb();

const User = db.define('user', {
  email: {
    type: DataTypes.STRING(255),
    unique: true,
    validate: /.*@.*/
  },
  password: {
    type: DataTypes.STRING(255)
  }
});

2. Create records

User.create({
  email: '[email protected]',
  password: '123456'
});

3. Query data

const allUsers = User.findAll(); // returns all users

const filtered = User.findOne({
  where: {
    email: { like: '%@example.com' }
  }
});

4. Validate types and uniqueness

User.create({
  email: 'invalid-email', // fails regex validation
  password: 123456         // fails string type check
});

🧪 Schema options (current support)

  • type: required — one of DataTypes
  • unique: boolean — ensures uniqueness in the dataset
  • validate: validates the input on insert
  • allowNull: force a field to have a value
  • defaultValue: default value for a field if not specify
  • ...

💡 Philosophy

The goal of jsondb-sequelize-like is to offer a zero-dependency, file-based DB that mirrors the experience of Sequelize — so you can:

  • prototype fast,
  • ship lightweight apps (embedded, CLI, offline tools),
  • and switch to Sequelize + Any SQL Database supported by sequelize later without rewriting your models and queries at all.

📁 Data Storage Structure

project/
├── data/
│   ├── table.json          ← snapshot (state)
│   └── history/
│       └── history.txt       ← append-only log

Snapshots are periodically written to disk and logs are replayed if needed.


📄 License

Custom : see LICENSE.md


🙌 Author

Aurélien Vaast – GitHub - trainingdev.fr - npm -