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

jsonb-db

v0.1.7

Published

in-memory-db for json data in nodejs application

Downloads

7

Readme

jsonb-db

In-Memory-db for json data in nodejs (javascript or typescript ) application

installation

install jsonb-cli then type jsonb install or npm install jsonb-db

usage

import json-db module in a project and instatiate JsonbDb class with db name as parameter

  const {JsonbDb} = require("jsonb-db");

  const db=new JsonbDb({db:"databaseName"}) ;

Get list of avalable collections in Db

  • db.collections()

Create empty collection

  • db.createCollection("collectionName")

create collection with data

  • db.createCollection("collectionName",data)

rename collection

  • db.updateCollection("oldcollectionName","oldcollectionName")

delete collection

  • db.dropCollection("collectionName")

fetch data from selected collection based on search criteria NOTE leave criteria empty if you want to search all data

  • db.collection("collectionName").find(criteria)

skip numbers of rows while retrieving data

  • db.collection("collectionName").find(criteria).skip(rowcount)

limit number of output rows

  • db.collection("collectionName").find(criteria).take(rowcount)

db.collection("collectionName").find(criteria).query fetch data in readable json format

fetch data and output in nice look json format

  • db.collection("collectionName").find(criteria).pretty()

fetch total number of output can be retrieved for provided criteria

  • db.collection("collectionName").find(criteria).count()

fetch data and output in tabular form

  • db.collection("collectionName").find(criteria).table()

Convert response to object

  • db.collection("collectionName").find(criteria).toObject

insert object into a collection, new collection will be created if not exist

  • db.collection("collectionName").insert(value)

insert many object into a collection, new collection will be created if not existed

  • db.collection("collectionName").insertMany(values)

delete items inside a collection based on search criteria

  • db.collection("collectionName").remove(criteria)

update items in a collection based on search criteria

  • db.collection("collectionName").update(criteria,value)