1.0.1 • Published 3 years ago

spikie.db v1.0.1

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

Installation

$ npm install spikie.db

Example

spikieDB

1. Importing the package

const { spikieDB } = require("spikie.db"); // or import { spikieDB } from "spikie.db"; 

2. Establishing and exporting spikieDB

const db = new spikieDB({ uri: "your mongodb connection string", }); module.exports = db; 

3. Example on using it

const db = require("./db.js"); // replace db.js with your file path to the setup of spikieDB db.set("numbers", "123"); 

Methods

.set

// saves data to database db.set("key", "value"); 

.get

// gets value from key db.get("key"); // returns => value 

.has

// returns boolean db.has("key"); // returns => true 

.delete

// deletes data db.delete("key"); // checking for data db.has("key"); // returns => false 
1.0.1

3 years ago

1.0.0

3 years ago