JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q41355F
  • License MIT

A lightweight and fast queue database server with WebSocket support for real-time data streaming

Package Exports

  • queuedb
  • queuedb/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (queuedb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

DroneQ

A lightweight and fast queue database server with WebSocket support for real-time data streaming.

Installation

npm install droneq

Quick Start

import { QDB, QDBServer } from 'droneq';

// Create a new QDB server
const server = new QDBServer("MyApp", {
    port: 3000,
});

// Create a new database instance
const db = new QDB("mydb", {
    username: "root",
    password: "",
});

// Mount the database to the server
server.mountDb(db);

// Start the server
server.listen();

API Documentation

QDBServer

The main server class that handles WebSocket connections and database management.

Constructor

new QDBServer(name: string, options: {
    port: number;
    host?: string;
    path?: string;
})
  • name: The name of your application
  • options: Server configuration options
    • port: The port number to listen on
    • host: (Optional) The host to bind to (defaults to 'localhost')
    • path: (Optional) The WebSocket path (defaults to '/ws')

Methods

  • mountDb(db: QDB): Mount a database instance to the server
  • listen(): Start the server and begin accepting connections

QDB (Queue Database)

The database class that handles queue-based data storage and retrieval.

Constructor

new QDB(name: string, options: {
    username: string;
    password: string;
})
  • name: The name of your database
  • options: Database configuration options
    • username: Database username
    • password: Database password

Queue Operations

The QDB class provides methods for queue-based operations:

  • enqueue(queueName: string, data: any): Add an item to the end of a queue
  • dequeue(queueName: string): Remove and return the first item from a queue
  • peek(queueName: string): View the first item in a queue without removing it
  • queueLength(queueName: string): Get the current length of a queue
  • clearQueue(queueName: string): Clear all items from a queue

Features

  • Queue-based data storage and retrieval
  • WebSocket-based real-time communication
  • SQLite backend for reliable data persistence
  • TypeScript support with full type definitions
  • Authentication support
  • Event-based architecture
  • Real-time queue updates to connected clients

Use Cases

  • Message queues
  • Task processing systems
  • Real-time data streaming
  • Event logging
  • Job scheduling
  • Data buffering

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build the project
npm run build

# Run tests
npm test

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.