npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@guidb/firestore

v0.0.1

Published

firebase store library :V no ads no track bro

Downloads

1

Readme


❄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