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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@salarizadi/vertex-db

v1.0.0

Published

A lightweight, powerful in-memory database for JavaScript/TypeScript applications with support for multiple data structures, relationships, transactions, and schema validation. Perfect for both browser and Node.js environments.

Readme

VertexDB 💾

License Version Downloads

A lightweight, powerful in-memory database for JavaScript/TypeScript applications with support for multiple data structures, relationships, transactions, and schema validation. Perfect for both browser and Node.js environments.

Features ✨

  • 🏃‍♂️ Lightweight and blazing fast in-memory operations
  • 📊 Table-based data structure with relationships
  • 🔒 Schema validation and type checking
  • 🕒 Automatic timestamps
  • 🗑️ Soft delete capability
  • 📝 Transaction support with rollback
  • 🔍 Advanced querying with multiple conditions
  • 📈 Indexing for faster searches
  • 🔄 Import/Export JSON functionality
  • 📱 Browser and Node.js compatibility
  • 🧮 Aggregation functions (count, avg, sum, min, max)
  • 📄 Pagination support
  • 🎯 Custom raw queries

Installation 📦

NPM

npm install @salarizadi/vertex-db

Yarn

yarn add @salarizadi/vertex-db

Browser

<script src="https://unpkg.com/@salarizadi/vertex-db"></script>

Quick Start 🚀

// Initialize VertexDB
const db = new VertexDB({
    logging: true,
    timestamps: true,
    softDelete: true
});

// Create a table with schema
const userSchema = {
    id: { type: 'number', required: true },
    name: { type: 'string', required: true },
    email: { type: 'string', required: true, pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ },
    age: { type: 'number', min: 18, max: 100 }
};

// Insert data
db.insert('users', {
    id: VertexDB.AUTO_INCREMENT,
    name: 'John Doe',
    email: '[email protected]',
    age: 20
});

// Query data
const users = db.where('name', 'John Doe').get('users');

Advanced Usage 🔥

Relationships

// Define relationships between tables
db.setRelation('posts', 'users', 'hasOne', 'user_id');

// Join tables
const postsWithUsers = db.join('posts', 'users', 'user_id', 'id');

Transactions

db.transaction((tx) => {
    tx.insert('users', { /* user data */ });
    tx.insert('posts', { /* post data */ });
    // Will rollback if any operation fails
});

Schema Validation

const schema = {
    title: { type: 'string', required: true },
    views: { type: 'number', min: 0 },
    status: { type: 'string', pattern: /^(draft|published)$/ }
};

db.createTable('posts', schema);

Advanced Queries

db.whereOperator('age', '>', 18)
  .whereLike('name', '%John%')
  .whereIn('status', ['active', 'pending'])
  .orderBy('created_at', 'DESC')
  .limit(10)
  .get('users');

Pagination

const result = db.paginate('users', 1, 10);
console.log(result.data); // Current page data
console.log(result.pagination); // Pagination info

API Reference 📚

Core Methods

  • createTable(tableName, schema?) - Create a new table
  • setTable(tableName, data, schema?) - Set table data with optional schema
  • insert(tableName, data) - Insert a single record
  • update(tableName, data) - Update records matching conditions
  • delete(tableName) - Delete records matching conditions
  • get(tableName) - Get all matching records
  • getOne(tableName) - Get first matching record

Query Methods

  • where(field, value, operator) - Add WHERE condition
  • whereOperator(field, operator, value) - Add WHERE condition with operator
  • whereLike(field, pattern) - Add LIKE condition
  • whereIn(field, values) - Add WHERE IN condition
  • orderBy(column, direction) - Sort results
  • limit(limit, offset) - Limit results
  • paginate(tableName, page, perPage) - Get paginated results

Utilities

  • backup() - Create database backup
  • restore(backup) - Restore from backup
  • toJSON(tableName) - Export table to JSON
  • fromJSON(tableName, jsonData) - Import from JSON
  • getStats() - Get database statistics
  • truncate(tableName) - Clear table data

License 📄

MIT © Salar Izadi

Contributing 🤝

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

Support 🌟

Give a ⭐️ if this project helped you!


Made with ❤️ by Salar Izadi