Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ElCholoGamer/directory.db
Flexible, elegant and blazing-fast data storage.
https://github.com/ElCholoGamer/directory.db
database npm-package typescript
Last synced: about 2 months ago
JSON representation
Flexible, elegant and blazing-fast data storage.
- Host: GitHub
- URL: https://github.com/ElCholoGamer/directory.db
- Owner: ElCholoGamer
- License: mit
- Created: 2021-02-02T21:43:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-02-02T23:10:52.000Z (over 3 years ago)
- Last Synced: 2024-04-23T20:05:43.420Z (5 months ago)
- Topics: database, npm-package, typescript
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blazingly-fast - directory.db - Flexible, elegant and blazing-fast data storage. (TypeScript)
README
# directory.db · ![Build status][build]
Flexible, elegant and blazing-fast data storage.
## Installation
Using npm:
```
$ npm i directory.db
```Using Yarn:
```
$ yarn add directory.db
```## Example usage
```js
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');
```[build]: https://github.com/ElCholoGamer/directory.db/workflows/Build/badge.svg