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

pluridb

v0.4.3

Published

A flexible database for the frontend

Downloads

23

Readme

Welcome to PluriDB

A flexible database for the frontend.

What is PluriDB?

PluriDB is a database capable to adapt to a lot of storage apis used in the frontend, including indexedDB and localstorage. It also uses fallbacks to check what the perfect storage will be for every user.

To access the database, you can use modules to use the language you are more confortable with, from SQL to MongoDB.

Main features

  • Compatible with any storage api (Included custom ones)
  • Compatible with many languages to access the database (Included custom ones)
  • Compatible with any datatypes (Included custom ones)
  • Compatible with web workers (Using a different thread will improve the performance of your webpage)
  • Works in both in browser and in node.
  • Works with any framework.
  • UMD and ESModule options available.
  • 0 dependencies.
  • Easy backups and restore from your server.

Demo

You can check an online demo of how the database works and what different operations you can use on it!

Installing PluriDB

You have two different methods to install PluriDB:

NPM

Installing PluriDB using NPM is as easy as using the command:

npm i --save pluridb

You can also install additional modules by checking the list.

CDN

You can use https://cdn.jsdelivr.net/npm/pluridb@latest/ to access the latests builds of PluriDB.

To use it directly from your page, use:

    <script src="https://cdn.jsdelivr.net/npm/pluridb@latest/PluriDB.js"></script>

You can also add additional modules by checking the list.

Quick start guide

Loading the modules

Before the instatiation of the database, you should load any of the modules you want to use to the database, since if you instatiate the database before, it won't be able to recognize any new modules.

To load a module, you can use:

    const PluriDB = require('pluridb');
    const PluriDBModule = require('pluridb-module');

    PluriDB.loadModule(PluriDBModule);

Learn more about modules here.

Instatiation of the database

During the creation of the instance you will set up the majority of the configuration paramethers the database is going to accept.

You can set it up like:

    db = new PluriDB('demo',{
        worker: true, // Will it use a webworker or not?
        api: 'indexdb', // What technology to use
        fallback: true, // Allows fallback?
        db:{
            backup: undefined, // function for backup
            restore: undefined, // function for restore
            encrypt: false, // password for encryption
        }
    });

You can learn more about the options you can set on the database here.

Initiate the database

After the instatiation of the database, you need to initiate it. This step ensures that all the modules are loading correctly and that the password to the database is correct.

Here we can see how to initiate the database:

    db.init((error, result)=>{
        if(error){
            console.error(error);
        }
        console.log(result);
    })

Or as a promise:

    db.promise.init().then(console.log).catch(console.error)

You can check more information on init and other high level operations of the database here.

Accessing and modifying the data.

Finally, for interacting with the database you can use a module as the api to interact with the data. You can access the list here.