directory.db
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

directory.db · Build status

Flexible, elegant and blazing-fast data storage.

Installation

Using npm:

$ npm i directory.db

Using Yarn:

$ yarn add directory.db

Example usage

import DirectoryDB from 'directory.db'; // ES Module
const DirectoryDB = require('directory.db').default; // CommonJS

// Create a database
const db = new DirectoryDB('./storage/user_data');

// Get a collection from the database
const users = db.getCollection('users');

// Get a document by UUID
const someUser = users.findByUUID('ee5dc2da-3211-4894-b0bb-7bb03fc1d0a0');
const username = someUser.get('username'); // Get a document property

// Get all documents that match a filter
const dogOwners = users.find({ pet: 'dog' });

// Insert a new document
const newUser = users.insertNew();
newUser.set('username', 'Deez_Nuts');
newUser.set('password', '123456');
newUser.set('pet', 'cat');

Package Sidebar

Install

npm i directory.db

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

18.6 kB

Total Files

25

Last publish

Collaborators

  • elchologamer