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

upps

v0.0.6

Published

Manage json database

Readme

Upps

Json databases it allows you to manage in an easy and detailed way.

Quick Start

Below we have assigned our module and the json file we will use.

const db = require('upps')
db.source = 'database.json'

/*  or another file
databases/database2.json , databases/mains/database1.json etc.
*/

Every time the source is changed, operations are made to the newly determined database source.

db.source = 'database1.json'
// some operations
db.source = 'database2.json'

.set(...more)

The set method is used to assign values ​​to keys. At least two parameters are given and the last parameter is always the value of the key. The key value can be a string, number, decimal number, or array. If the parameters are more than two, the key automatically takes the form of an object.

...
db.set('upps','monthly data','downloads',45)

/*  After this process, our database will look like this:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

.get(...more)

The get method is used to get values ​​of keys or objects.With more than one parameter, the values ​​of nested objects or the keys inside them can be retrieved. If the data is not in the database, the method returns undefined. And the note is printed to the console.

...
/*  Selected database source:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

data = db.get('upps')
console.log(data)

/* Prints to console
> { 'monthly data': { downloads: 45 } }
*/

data = db.get('upps','monthly data','downloads')
console.log(data)

/* Prints to console
> 45
*/

.delete(...more)

The delete method deletes data from database according to given parameters. If the data is not in the database, the method returns undefined. And the note is printed to the console.

...
/*  Selected database source:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

db.delete('upps')

/*  New version of the selected database resource:
{}
*/

db.delete('upps','monthly data','downloads')

/*  New version of the selected database resource:
{
 "upps": {
  "monthly data": {}
  }
}
*/

.has(...more)

The has method specifies whether the key in the given parameters exists or not. Returns true if yes, false if not.

/*  Selected database source:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

...
console.log(db.has('upps'))
console.log(db.has('upps','monthly data'))
console.log(db.has('ı<3u'))

/* Prints to console
> true
> true
> false
*/

.fetchAll()

The fetchAll method returns the entire selected database resource.

/*  Selected database source:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

...
allData = db.fetchAll()
console.log(allData)

/* Prints to console
> { upps: { 'monthly data': { downloads: 45 } } }
*/

.clearAll()

The clearAll method clears all data in the selected database resource.

/*  Selected database source:
{
 "upps": {
  "monthly data": {
   "downloads": 45
    }
  }
}
*/

db.clearAll()

/*  New version of the selected database resource:
{}
*/

Thanks for supporting me using my package.

I will bring new features and fixes to the package soon.

Contact me (discord): siaeyy#6434

Update Log :

  • The error in the readme.md has been fixed