Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@guidb/firestore

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guidb/firestore

firebase store library :V no ads no track bro

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Buy Me A Coffee


❄Content-Library

  • 📰 0% Ads
  • 💸 0% Tracker
  • 📃 0% Logging

❄Docs

  1. constructor new firestore(data, encrypt) example

    type data = json / string type encrpy = boolean

    if encrypt fill data base 64 not "./firebase.json"

    if no encrypt fill data "./firebase.json" get base 64 data here https://jpillora.com/base64-encoder/

example

//--! no encrpyt !--\\
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")

//--! data encrpyt !--\\
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("data:application/json;base64,ewogICJ0eXBl.*", true)

  1. Get All getAll(name) example
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")

async function test() {
    var getall = await db.getAll("users")
    console.log(getall)
}
test()
//--! Result log here !--\\
/*
[
  {
    id: '0bQBHNASCO2UDbiQvvx2',
    data: { born: 1815, first: 'Ada', last: 'Lovelace' },
    time: { update_seconds: 1626377997, update_nanoseconds: 305257000 }
  },
  {
    id: '3JijGaZpac8ONq3pKBy3',
    data: { last: 'Lovelace', born: 1815, first: 'Ada' },
    time: { update_seconds: 1626377449, update_nanoseconds: 553502000 }
  },
  {
    id: 'AhDWWUrGSpKeLgLHzSLV',
    data: { first: 'Ada', born: 1815, last: 'Lovelace' },
    time: { update_seconds: 1626378647, update_nanoseconds: 848145000 }
  },
  {
    id: 'RncOIs28UpkGytJ4VPGO',
    data: { born: 1815, last: 'Lovelace', first: 'Ada' },
    time: { update_seconds: 1626378648, update_nanoseconds: 570016000 }
  },
  {
    id: 'Y7aFXiYZwdj07m0da3RP',
    data: { last: 'Lovelace', born: 1815, first: 'Ada' },
    time: { update_seconds: 1626377444, update_nanoseconds: 724274000 }
  },
  {
    id: 'data',
    data: { data: 'oke' },
    time: { update_seconds: 1626382819, update_nanoseconds: 730519000 }
  },
  {
    id: 'data1',
    data: { version: '2', title: 'new title' },
    time: { update_seconds: 1626384801, update_nanoseconds: 749878000 }
  },
  {
    id: 's00VrxQ4gqxcC4d4QSUd',
    data: { first: 'Ada', born: 1815, last: 'Lovelace' },
    time: { update_seconds: 1626378000, update_nanoseconds: 269695000 }
  },
  {
    id: 'uhnILsXYzDagVwTn59Bs',
    data: { last: 'Lovelace', first: 'Ada', born: 1815 },
    time: { update_seconds: 1626377530, update_nanoseconds: 248835000 }
  },
  {
    id: 'user',
    data: { km: [Array] },
    time: { update_seconds: 1626382982, update_nanoseconds: 392675000 }
  }
]

*/
  1. Get get db.get(name, id) example
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")
async function test() {
    var get = await db.get("users", "data1")
    console.log(get)
}

test()
//--! Result log here !--\\
/*
{
  id: 'data1',
  data: { version: '1', title: 'hay' },
  time: { update_seconds: 1626384800, update_nanoseconds: 691138000 }
}
*/
  1. add add(name, id, data) example
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")
async function test() {
    var dataa = {
        "title": "hay",
        "version": "1"
    }
    var add = await db.add("users", "data1", dataa)
    console.log(add)
}

test()
//--! Result log here !--\\
/*
{ writeTime: { seconds: 1626384800, nanoseconds: 691138000 } }
*/
  1. update update(name, id, data_update) example
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")
async function test() {
    var data_update = {
        "title": "new title",
        "version": "2"
    }
    var update = await db.update("users", "data1", data_update)
    console.log(update)
}

test()
//--! Result log here !--\\
/*
{ writeTime: { seconds: 1626384801, nanoseconds: 749878000 } }
*/
  1. delete delete(option) example
var firestore = require("@guidb/firestore")
var db = new firestore.firestore("./firebase.json")
async function test() {
    var Option = {
        "type": "doc",
        "name": "users",
        "doc" : "datatemp"
    }
    var delet = await db.delete(Option)

    console.log(delet)
}

test()
//--! Result log here !--\\
/*
WriteResult {
  _writeTime: Timestamp { _seconds: 1626384802, _nanoseconds: 380867000 }
}


*/

❄To-Do

A list that i should do more for this project...

  • ✔ crud
  • 🔜 clone
  • 🔜 diagram

🖥Requirements

  • Node v10+ (Node v14 Recommended)
  • Network connection

Keywords

FAQs

Package last updated on 16 Jul 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc