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

mzrdb

v1.6.0

Published

User-friendly database module supporting JSON, MongoDB, YAML, and BSON formats for seamless data management.

Downloads

122

Readme

New version 1.6.0!

  • findOne function added!

About

  • Designed for Beginners: The mzrdb module simplifies working with databases for new programmers. It provides an intuitive key-value interface, making data storage and retrieval a breeze.
  • Built on Proven Technologies: mzrdb leverages established database tools like Mongoose, Json, Yaml and Bson. This ensures compatibility and a familiar experience for developers.
  • Future-Proof Flexibility: The mzrdb module is designed with expandability in mind. Support for additional database types is planned for future releases, offering even greater flexibility.

Features

  • Beginner-friendly
  • All-inclusive
  • Easy to use
  • Customizable separators
  • Key-value methods
  • Quick response times
  • Seamless database switching

Benefits

  • Streamlined development process
  • Optimal performance and efficiency
  • Ultimate flexibility
  • Open-source and actively maintained
  • Extensive documentation and tutorials
  • Reliable and robust solutio

Moving Data From Quick.DB to mzrdb (Local Database)

const db = require('mzrdb');
const quickdb = require('quick.db');

await db.move(quickdb);

Moving Data From mzrdb to MongoDB

const db = require('mzrdb');
const jsondb = require('../yourFile.json');
db.setAdapter('mongodb', { url: 'yourMongoURL' });

await db.moveToMongo(jsondb);

All Mongo Adapter Methods

const db = require('mzrdb')

db.setLanguage('en') // en
db.setCheckUpdates(true) // true
db.setAdapter('mongodb', { url: 'yourMongoURL', schema: 'mzrdb', seperator: '.' }) // true
db.setFolder('mzrdb') // true
db.setFile('mzrdb') // true
db.setSeperator('-') // true

await db.set('key.mzr', 'value') // key: { mzr: "value" }
await db.set('key', 'value') // key: "value"

await db.add('key2', 1) // 1
await db.sub('key2', 1) // 0
await db.subtract('key2', 1) // 0

await db.get('key') // "value"
await db.fetch('key') // "value"

await db.all() // { key: "value" }
await db.getAll() // { key: "value" }
await db.fetchAll() // { key: "value" }

await db.all('object') // [[ "key", [ "value" ] ]]
await db.all('keys') // [ "key" ]
await db.all('values') // [ [ "value" ] ]

await db.push('key', 'value') // key: ["value"]
await db.push('key', 'mzr') // key: ["value", "mzr"]
await db.unpush('key', 'value') // ["mzr"]

await db.push('key', { mzr: 'value' }) // [ { mzr: "value" }]
await db.push('key', { mzr2: 'value2' }) // [ { mzr: "value" }, { mzr2: "value2" } ]

await db.delByPriority('key', 1) // [ { mzr2: "value2" } ]
await db.setByPriority('key', { new2: 'This Edited!' }, 1) // [ { new2: "This Edited!" } ]

await db.find('key', { mzr: 'value' }) // [ { mzr: "value" } ]
await db.findOne('key', { mzr: 'value' }) // { mzr: "value" }

await db.findAndUpdate('key', { mzr: 'value' }, { mzr: 'value2' }) // [ { old: { mzr: "value" }, new: { mzr: "value2" } } ]
await db.findAndDelete('key', { mzr: 'value' }) // [ { mzr: "value" } ]

await db.findOneAndUpdate('key', { mzr: 'value' }) // { old: { mzr: "value" }, new: { mzr: "value2" } }
await db.findOneAndDelete('key', { mzr: 'value' }) // { mzr: "value" }

await db.type('key') // string
await db.has('key') // true
await db.check('key') // true

await db.del('key') // true
await db.delete('key') // true

await db.deleteAll() // true (Cleans database)
await db.clear() // true (Cleans database)

await db.backup('fileName') // true (Backups database)
await db.destroy() // true (Deletes database file)

await db.uptime() // 30000 (Milliseconds)

await db.connecetion() // true
await db.disconnect() // true
await db.deleteMongo() // true

await db.exports('fileName') // true (Highly advanced)
await db.export('fileName') // true (Highly advanced)

await db.length() // 20 (Character count)

db.ping // { read: "1ms", write: "2ms", average: "1.5ms" }
db.size // 11 Bytes (Database size)
db.version // 1.6.0 (Module version)

All Local Adapter Methods

const db = require('mzrdb')

db.setLanguage('en') // en
db.setReadable(false) // false
db.setNoBlankData(false) // false
db.setCheckUpdates(true) // true
db.setAdapter('jsondb') // true
db.setFolder('mzrdb') // true
db.setFile('mzrdb') // true
db.setSeperator('-') // true

db.set('key.mzr', 'value') // key: { mzr: "value" }
db.set('key', 'value') // key: "value"

db.add('key2', 1) // 1
db.sub('key2', 1) // 0
db.subtract('key2', 1) // 0

db.get('key') // "value"
db.fetch('key') // "value"

db.all() // { key: "value" }
db.getAll() // { key: "value" }
db.fetchAll() // { key: "value" }

db.all('object') // [[ "key", [ "value" ] ]]
db.all('keys') // [ "key" ]
db.all('values') // [ [ "value" ] ]

db.push('key', 'value') // key: ["value"]
db.push('key', 'mzr') // key: ["value", "mzr"]
db.unpush('key', 'value') // ["mzr"]

db.push('key', { mzr: 'value' }) // [ { mzr: "value" }]
db.push('key', { mzr2: 'value2' }) // [ { mzr: "value" }, { mzr2: "value2" } ]

db.delByPriority('key', 1) // [ { mzr2: "value2" } ]
db.setByPriority('key', { new2: 'This Edited!' }, 1) // [ { new2: "This Edited!" } ]

db.find('key', { mzr: 'value' }) // [ { mzr: "value" } ]
db.findOne('key', { mzr: 'value' }) // { mzr: "value" }

db.findAndUpdate('key', { mzr: 'value' }, { mzr: 'value2' }) // [ { old: { mzr: "value" }, new: { mzr: "value2" } } ]
db.findAndDelete('key', { mzr: 'value' }) // [ { mzr: "value" } ]

db.findOneAndUpdate('key', { mzr: 'value' }) // { old: { mzr: "value" }, new: { mzr: "value2" } }
db.findOneAndDelete('key', { mzr: 'value' }) // { mzr: "value" }

db.type('key') // string
db.has('key') // true
db.check('key') // true

db.del('key') // true
db.delete('key') // true

db.deleteAll() // true (Cleans database)
db.clear() // true (Cleans database)

db.backup('fileName') // true (Backups database)
db.loadBackup('./mzrdb-backup') // true
db.destroy() // true (Deletes database file)

db.startsWith('ke') // [ { key: "key", data: "value" } ]
db.includes('e') // [ { key: "key", data: "value" } ]
db.endsWith('ey') // [ { key: "key", data: "value" } ]

db.length('object') // 1 
db.length() // 20 (Character count)

db.ping // { read: "1ms", write: "2ms", average: "1.5ms" }
db.size // 11 Bytes (Database size)
db.version // 1.6.0 (Module version)

Contact & Support

Discord Server