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

rezidb

v3.0.0

Published

ReziDB - High Performance Clustered Database

Downloads

2

Readme

ReziDB

npm npm NPM

An Mighty Database Based On LevelDB

NPM

Features

  • Sharding Support
  • Based On LevelDB
  • Works In Multiple Processes
  • Small and Fast
  • Works With Buffers
  • IPC Clustering
  • Cache support

Installation

~ npm install rezidb

Usage

Basic Usage

const ReziDB = require('rezidb')

const db = new ReziDB({
    name: 'Test',
    path: './data',
    cluster: false,
    cache: true
})

await db.set('Hello', 'World 🌎')

console.log(await db.get('Hello'))

console.log('Data: ', await db.toJSON())

API

new ReziDB({ name: string, path: string, cluster: boolean, cache: boolean | { maxSize: number } })

Construct a new ReziDB instance. Can Be Clustered. Cache maxSize defaults to 1,000 items

db.set(key, value, path) -->> null

Set a key and a value with an optional path

db.setStream(key, stream, path) -->> null

Set a key and a stream. Has an optional path.

db.setStreamBuffer(key, stream, path) -->> null

Set a key and a stream as a buffer. Has an optional path.

db.ensure(key, value) -->> null

If the database does not have it, set it.

db.get(key, path) -->> any

Get data from the database. Also has a path option.

db.getStream(key, path) -->> ReadableStream

Get data from the database as a stream. Also has a path option.

db.has(key, path) -->> boolean

Check if the database has a key. Also has a path option.

db.delete(key) -->> null

Delete a key from the database.

db.clear() -->> null

Clear the whole database

db.observe(key, path) -->> object

Returns an object that will save to the database on change.

db.push(key, value, path) -->> null

Push data to the provided array. Also has a path option.

db.splice(key, position, path) -->> null

Splice data in the provided array. Also has a path option.

db.shift(key, path) -->> null

Shift data in the provided array. Also has a path option.

db.unshift(key, items, path) -->> null

Unshift data in the provided array. Also has a path option.

db.includes(key, value, path) -->> boolean

Check if the provided array or string includes a value. Also has a path option.

db.pop(key, path) -->> null

Pop data from the provided array. Also has a path option.

db.batch() -->> Batch

Create a batch constructor. Can be called to write data very fast.

db.keys() -->> Array

Get all of the keys in the database.

db.values() -->> Array

Get all of the values in the database.

db.entries() -->> Array

Get all of the entries in the database.

db.forEach(callback) -->> null

Iterate through all of the keys and values of the database.

db.random() -->> object

Get a random key and value from the database.

db.find(callback) -->> any

Find a key or value in the database. Similar to array.find().

db.filter(callback) -->> any

Find a key or value in the database. Similar to array.filter().

db.search(query) -->> Array

Search the whole database for a query.

db.size() -->> number

Get the size of the database.

db.toJSON() -->> object

Get the whole database as a JSON object.

db.toArray() -->> Array

Get the whole database as an Array.