Skip to content

germanschnyder/neverminDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neverminDB

A database so minimal, you'll never mind it exists.

What is this?

This is a database that's intentionally as simple as possible. It's so basic that you'll probably never mind using it. Get it? "Never mind" + "DB" = neverminDB?

...yeah, we know it's not that funny.

Features

  • ✅ Store key-value pairs in memory
  • ✅ Retrieve values by key
  • ✅ Delete keys
  • ✅ List all keys
  • ✅ That's it. Seriously.

Installation

npm install nevermindb

Usage

JavaScript API

const NeverminDB = require('nevermindb');

const db = new NeverminDB();

// Store something (if you care)
db.set('important_data', 'probably not that important');

// Get it back (if you remember what you stored)
const data = db.get('important_data');

// Delete it (if you change your mind)
db.delete('important_data');

// List all keys (if you're curious)
const keys = db.keys();

Command Line Interface

# Run the CLI
npm run cli

# Or use the global command (after npm install -g)
nevermindb

Available commands:

  • set <key> <value> - Store a key-value pair
  • get <key> - Retrieve a value
  • delete <key> - Delete a key-value pair
  • has <key> - Check if a key exists
  • keys - List all keys
  • values - List all values
  • size - Show database size
  • clear - Clear all data
  • stats - Show database stats
  • random - Get a random key
  • help - Show help
  • exit - Exit the CLI

Web Interface

# Start the web interface
npm run web

Then open your browser to http://localhost:3000 for a beautiful web interface to interact with your minimal database.

API Reference

Core Methods

  • set(key, value) - Store a key-value pair
  • get(key) - Retrieve a value by key
  • delete(key) - Delete a key-value pair
  • has(key) - Check if a key exists
  • keys() - Get all keys
  • values() - Get all values
  • entries() - Get all key-value pairs
  • clear() - Clear all data
  • size() - Get the number of key-value pairs
  • isEmpty() - Check if the database is empty
  • randomKey() - Get a random key (because why not?)
  • stats() - Get database statistics

Examples

Basic Usage

const db = new NeverminDB();

// Store some data
db.set('name', 'neverminDB');
db.set('version', '1.0.0');
db.set('purpose', 'to be as minimal as possible');

// Retrieve data
console.log(db.get('name')); // 'neverminDB'

// Check if key exists
console.log(db.has('version')); // true

// Get all keys
console.log(db.keys()); // ['name', 'version', 'purpose']

// Get database size
console.log(db.size()); // 3

// Get random key
console.log(db.randomKey()); // random key from the database

// Get stats
console.log(db.stats());

Running Examples

# Run the basic example
npm start

# Run tests
npm test

# Start CLI
npm run cli

# Start web interface
npm run web

Why does this exist?

Honestly? We're not sure either. But sometimes you need a database that's so simple, you never mind it's there.

License

MIT (because we don't really mind what you do with it)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published