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

@chrisaxxwell/merlin-db

v1.4.0

Published

Use your mongoDB and Mongoose techniques in IndexedDB with merlinDB.

Downloads

110

Readme

Logo

MerlinDB

MerlinDB was developed to simplify and improve the use of the IndexedDB API in web browsers. MerlinDb allows developers to add, get, update and remove data at scale, providing a fluid and effective experience. Inspired by the renowned MongoDB.

Installation

Install merlinDB with npm or download

  npm install @chrisaxxwell/merlin-db

Usage/Examples

import MerlinDB, { Schema } from "@chrisaxxwell/merlin-db";
//Or if you are using 'merlindb.min.js' just call 'new MerlinDB()';

Call the new MerlinDB():

const merlin = new MerlinDB();

Connect to database:

merlin.connect(<YOUR-DATABASE-NAME>);

Create an Schema:

var usersSchema = Schema({
  email: {
    type: String,
    unique: true,
  },
  name: { type: [String], required: true },
  age: [Number, String],
  city: String,
});

Initialize your new model:

const Users = merlin.model("Users", usersSchema);

CRUD (Insert, Update and Remove):

//Insert
Users.insert({ name: "Chris", age: 27 }).then((e) => console.log(e));

//Find
Users.find({ age: 27 }).then((e) => console.log(e));

//Update
Users.updateOne(
  {
    //Every name = Sophie
    name: { $regex: ["Sophie", "i"] },
  },
  { $set: { name: "Lady Sophie" } }
);

//Delete
Users.deleteOne({ name: "Chris" }).then((e) => console.log(e));

Full code:

import MerlinDB, {Schema} from "@chrisaxxwell/merlin-db";

const merlin = new MerlinDB();
merlin.connect(<YOUR-DATABASE-NAME>);

var usersSchema = Schema({
   email: {
      type: String,
      unique: true
   },
   name: { type: [ String ], required: true },
   age: [ Number, String ],
   city: String,
});


Users.insert({ name: "Chris", age: 27 }).then(e => console.log(e));

Users.find({ age: 27 }).then(e => console.log(e));

Users.updateOne({

   name: { $regex: ["Sophie", "i"] } },
   { $set: { name: "Lady Sophie" }
});

Users.deleteOne({ name: "Chris" }).then(e => console.log(e));

Documentation

To see full documentation access https://merlindb.chrisaxxwell.com.

FAQ

- Why MerlinDB?

MerlinDB was carefully developed to simplify and improve the use of the IndexedDB API in web browsers. MerlinDb allows developers to add, get, update and remove data at scale, providing a fluid and effective experience. Inspired by the renowned MongoDB and Mongoose, MerlinDB is a sophisticated and intuitive tool especially designed for those familiar with MongoDB and Mongoose. Its intuitive interface and powerful features make it the ideal choice for professionals looking for superior productivity and performance in their web development projects.

- Where can I see a basic tutorial?

Access https://merlindb.chrisaxxwell.com/docs

- How can I use encryption in merlinDB?

Encrypt: https://merlindb.chrisaxxwell.com/manual/reference/insert/

Decrypt: https://merlindb.chrisaxxwell.com/manual/reference/find/

- How to test quickly??

Encrypt: https://merlindb.chrisaxxwell.com/admin/

- Its free?

YUP totally free

Color Reference

| Color | Hex | | ------- | ---------------------------------------------------------------- | | color-1 | #250649 #250649 | | color-2 | #2d0c55 #2d0c55 | | color-3 | #3f1e71 #3f1e71 |

Authors

Feedback

If you have any feedback, please reach out to us at [email protected]

Support

For support, email [email protected] or join our Slack channel.

License

MIT