0.5.3 • Published 3 years ago

@ashikuri/table-db v0.5.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

table-db

Tiny database interfacer 🐜

Install

$ npm i @ashikuri/table-db
or
$ yarn add @ashikuri/table-db

Usage

import TableApp from "@ashikuri/table-db"
import { JSONAdapter } from "@ashikuri/table-db/adapters"

async function application(){
    const db = new TableApp("./database.json", JSONAdapter)
    const users = await db.collection("users")

    // return users
    await users.insert({
        id: 0,
        name: "John Doe",
        email: "john@doe.com",
        online: true
    }, {
        id: 1,
        name: "John Doe 2",
        email: "john2@doe.com",
        online: false
    })
    // ...
    // note: Collection.save is an alias as db.save
    await users.save() // or db.save() or db.write()
}
application()
0.5.3

3 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.3.1

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago