Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ad-si/ybdb
YAML Based Database
https://github.com/ad-si/ybdb
database file-system yaml
Last synced: 2 months ago
JSON representation
YAML Based Database
- Host: GitHub
- URL: https://github.com/ad-si/ybdb
- Owner: ad-si
- Created: 2016-03-01T21:55:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T23:16:31.000Z (over 7 years ago)
- Last Synced: 2024-11-21T14:23:13.642Z (3 months ago)
- Topics: database, file-system, yaml
- Language: JavaScript
- Size: 41 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# YBDB
**Y**AML **B**ased **D**ata**b**ase
Uses [lowdb](https://github.com/typicode/lowdb) for
accessing and manipulating data.
The storage consists of one/several YAML files.## Installation
```shell
npm install --save ybdb
```## Usage
`songs.yaml`:
```yaml
- title: Song One
length: 02:16- title: Another Song
length: 01:33- title: The Song
length: 03:41
``````js
const Ybdb = require('ybdb')
const database = new Ybdb({
storageFile: path.join(__dirname, 'songs.yaml'),
})
const initializedDb = await database.init()
const expectedData = {
songs: [
{
title: 'Song One',
length: '02:16',
},
{
title: 'Another Song',
length: '01:33',
},
{
title: 'The Song',
length: '03:41',
}
]
}assert.deepEqual(initializedDb.getState(), expectedData)
```