New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dbhub

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbhub

Using npm

latest
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

##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')

Keywords

dbhub

FAQs

Package last updated on 12 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts