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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pseudodb

v1.4.4

Published

Imititates a realtime database(Firebase) by storing data in a JSON File

Readme

PseudoDB

Lite & fast DB simulator for testing.

var pdb = require('pseudodb');

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install pseudodb

Features

  • Makes code testing easier
  • Mimics Firestore
  • Now supports graphDB properties

Functions

To create a new DB:

pdb.createDb(db_name);

To add a new document with a random id:

var id = pdb.addDoc(db_name, data_Object); //Returns the randomly created id

To create a new document with a specific id or to modify an exisitng document

pdb.setDoc(db_name, id, data_Object);

To change a particular field of a document

pdb.setField(db_name, id, field, value);

To get details of a particular document

var result = pdb.getDoc(db_name, id);

To get details of a particular db

var result = pdb.getDb(db_name);

To find a particular document in a db

var id = pdb.findDoc(db_name, field_name, value); // FInds the first occuring match and returns the id

To find documents matching a criteria in a db

var id = pdb.findAll(db_name, field_name, value); // Finds all occuring matches and returns an array of ids


To add a relation to a doc with another doc

pdb.setRel(db, from_doc, relation, to_doc); // Sets relation from doc with id a to doc with id b

To add a relation group to a doc with another doc

pdb.setRelGrp(db, from_doc, relation, to_doc); // Adds a  relation from a to b in the relation group

To get a relation of a doc

console.log(relations.getRel(db, doc, relation)); // Logs the relation of the doc

To delete a doc

pdb.deleteDoc(db_name, doc_id);

To delete a db

pdb.deleteDb(db_name);

To Monitor Changes in a db

subscribe(db).on('dbChange', callBack(currentDbContent, previousDbContent));

Example Code

const pdb = require('pseudodb');

pdb.createDb('test'); //Create a db with name test

pdb.addDoc('test', {
	name: 'Elliot',
	age: 18,
}); /*Add a new document with a random id.
Take a look at the new file named test to see the added document
*/

pdb.setDoc('test', 'a', { name: 'Alwin', age: 23 }); //Creates a doc with the id 'a' and stores the object

pdb.setDoc('test', 'a', { name: 'Alwin', age: 20 }); //Changes the document with the id a

pdb.setField('test', 'a', 'name', 'Rex'); //Changes the field name of the document with id a

pdb.setField('test', 'a', 'Developer', 'No'); //Adds a new field Developer

pdb.setRel('test', 'a', 'brother', 'b'); // Sets brother relation from doc with id a to doc with id b

console.log(pdb.getDoc('test', 'a')); // Logs the content of the doc with id a to the console

console.log(pdb.getDb('test')); // Logs the content of the db to the console

console.log(pdb.getDoc('test', 'a').name); //Since the getdoc function returns an object, you can access the fields this way

console.log(pdb.findDoc('test', 'name', 'Alwin')); //Logs the id of the document which has the field 'name' as 'Alwin'

console.log(pdb.findAll('test', 'age', 20)); //Logs an array of ids of all docs which has age as 20

subscribe('test').on('dbChange', (curr, prev) =>
	console.log('Current: ', curr, ' Previous: ', prev)
); // Monitors the db and Logs current and previous content of the db when db is changed

console.log(relations.getRel('test', 'a', 'brother')); // Logs the brother relation of the doc a

pdb.deleteDoc('test', 'a'); // Deletes the doc with id a

pdb.deleteDb('test'); //Deletes the db