0.2.1 • Published 3 years ago

dbhub v0.2.1

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

##Installing Using npm

$ npm install dbhub

##Usage Get your api key for the database on website

After that include packet in your code:

const {getDatabase}  = require('dbhub');

Create your database:

let apikey = 'xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
let db = getDatabase(apiKey)

Get collection(table) from database:

let collection = db.getCollection(collectionName)

##CRUD Create new element in collection:

collection.create(element)

Read element in collection:

collection.read(id)

Update element in collection:

collection.update(id, element)

Delete new element in collection:

collection.delete(id)

From each CRUD function will be returned Promise, so you need to use then or await

let result = await collection.create(element)
let result = await collection.read(id)
collection.update(id, element).then('Updated')
collection.delete(id).then('Deleted')
0.2.1

3 years ago

0.2.0

3 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago