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

ez.database

v1.0.7

Published

Easy to use and lightweight MongoDB Wrapper Database for beginners.

Readme

Ez.Database

Ez.Database is an extremely light, and straightforward MongoDB Database wrapper.

Note: The package is still in development, and is not completely ready to use yet.


Ez.Database was created to make the process of using MongoDB very easy and quick, so that even a complete beginner could understand how a Database works, and get started using one.

Why choose Ez.Database?

Beginner Friendly - It's very easy for a beginner to use the db, and it only takes a few seconds to get setup, and connect to MongoDB.

Light - Ez.Database is extremely light, comprised with only a few files, which makes it very fast to run.

Simplifies Schemas - The package simplifies Schemas, and instead uses the set, has, and get method, to simplify the process, making it easy to set, check, and get data.


Installation

After you have initialized node, run this command:

npm install ez.database

API Documentation

With our step by step Guide, you can get started in seconds! For the full API documentation, please visit our website, at WEBSITENAME.

Note: Since this is meant for absolute beginners, the guide will have everything from setting up MongoDB, getting your connection string, to connecting to the Database and using the methods. If you are not an absolute beginner, feel free to skip to certain parts in the guide.

Setup

To get the project started, run the command npm init -y, to initalize your project as node:

npm init -y

After that, please run the installation command for this Database.


Setting up MongoDB

Creating An Account

To setup a Database, please visit MongoDB's Website. Next, click login, and from there, click sign up. You can either create an account, or sign up with Google.


Installing MongoDB Compass

Next, we're going to install MongoDB Compass. Compass is good for visualising and understanding data, and query syntax. It also makes managing your Databases and Collections easier. To install it, visit the Compass Download Page, and click download.


Creating a Cluster + Connecting to Cluster

When Compass is finished installing, open it up. You should see a screen where you need to paste your connection string.

To get the connection string, we need to make a Cluster, which we are going to connect to in Compass. Please go to the MongoDB website.

There should be a screen which says Clusters, Create a New Cluster, and many more things. Click on the Create a New Cluster button. You can specify your Cloud Provider and Region, but for free access, select a region with the symbol FREE TIER AVAILABLE, and ideally one close to where you are, for better connection. You can specify your Cluster name, then hit Create Cluster.

It should take a few seconds/minutes to create. Meanwhile, we're going to create a user, so we can authenticate into our Cluster.

Click the Database Access button. There, add a new Database User, and make the user's name, and password, and click Add User.

Once your Cluster is finished being made, click the Connect button, and select Connect using MongoDB Compass. There, you will see your connection string. Copy it. Finally, go back to Compass, and paste your connection string. You will need to replace the password text, with your user password.

Note: You can only have one free Cluster. If you would like to create an additional Cluster, you have to pay a small fee to MongoDB.


Creating a Database and Collection

Now, you need to create a Database. In Compass, click the Create Database button, and specify your Database and Collection name. Next, click Create Collection, and specify your collection name.

You are now all set up with MongoDB! Let's see how to use Ez.Database!


Using Ez.Database

Connecting to MongoDB with Ez.Database

Getting started using Ez.Database is very easy, and takes a few seconds.

In order to connect to MongoDB, we need to make a variable for our connection string. Since the connection string is a sensitive piece of information, we are going to store it in a seperate JSON file. Name that file ConnectionString.json.

Make an object called MongoConnectionString, which will hold the string. Paste the following code into that file:

{
    "MongoConnectionString": "yourconnectionstring"
}

You'd use the same connection string you used to connect in MongoDB Compass.

Now, make a file called db.js. Here, paste the following code:

const { MongoConnectionString } = require('./ConnectionString.json')

const EzDatabase = require('ez.database')
const db = new EzDatabase()

db.connect(MongoConnectionString,
    console.log('Connected to Database')
)

How does this work? First, the MongoConnectionString object is required, from our JSON file. The technique used is called Object Destructuring.

Then, we require the actual Ez.Database module. After that, we make a variable called db, which is an instance of the Ez.Database class.

Next, we use the connect method, to connect to our MongoDB database, while passing in our connection string to do so. We also log the message we want when we have connected to MongoDB.


Storing, Getting, and Checking Data

Ez.Database simplifies the process of creating Schemas, and instead just uses the set, get, and has methods. Add the follow code to your file:

const { MongoConnectionString } = require('./ConnectionString.json')

const EzDatabase = require('ez.database')
const db = new EzDatabase()

db.connect(MongoConnectionString,
    console.log('Connected to Database')
)

//What you're adding
db.set('Dataset', {data: object})
db.get(Dataset.data)
db.has(Dataset.Data)

db.save()

The set method sets Data, and you can set your Dataset name. It also takes 2 parameters. The first one is the actual Dataset name, and the second is the property and object.

The get method gets Data, from a specific Dataset, and access the property and object in that Dataset.

The has method returns either true, or false. It's used for checking if a certain Dataset has some data.

Finally, the save method saves all of your data, to the Database.

Dependencies

Ez.Database has two Dependencies:

  1. Mongoose
  2. MongoDB

Update Log

Future updates will be written here.


Please share the package with your friends, and hope you found Ez.Database useful!