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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ming-suhi/djs-firestore

v0.1.0

Published

A package for managing your Discord bot's structured Firestore.

Downloads

7

Readme

I. About

A package for managing your Discord bot's structured Firestore. For an in-depth documentation visit the documentation website.

II. Getting Started

A. Installing

Run npm install on the command line or terminal.
npm install @ming-suhi/djs-firestore

B. Setting environment

  1. Create a .env file in the root directory

    PROJECT_ID=
    CLIENT_EMAIL=
    PRIVATE_KEY=
  2. Get project_id, client_email, and private_key of your Firebase service account and store it correspondingly.

C. Setting up manager

  1. Require FirestoreManager

    const { FirestoreManager } = require('@ming-suhi/djs-firestore');
  2. Attach an instance to discord client.

    client.db = new FirestoreManager();
  3. Initialize guilds.

    client.db.initializeGuilds(client);

D. Creating base documents

  1. Listen to guildCreate

    client.on('guildCreate', async guild => {
      // Code here
    });
  2. Create guild doc.

    // If needed require GuildDocument
    const { GuildDocument } = = require('@ming-suhi/djs-firestore');
    // Check if a guild doc for the guild exist
    var guildDb = client.db.guilds.get(guild.id);
    // If not existing create document
    if (!guildDb) {
      var guildDb = new GuildDocument(guild.id);
      guildDb.initialize();
      await guildDb.update({id: guild.id, name: guild.name});
      // Put a reference to guilds
      client.db.guilds.set(guild.id, guildDb);
    }

E. Other methods

  1. Get field method

    const guildDb = client.db.guilds.get(guildId);
    const fieldValue = guildDb.get('fieldName');
    console.log(fieldValue);
  2. Update method

    const guildDb = client.db.guilds.get(guildId);
    await guildDb.update({"updated": true});
  3. Delete method

    const guildDb = client.db.guilds.get(guildId);
    await guildDb.delete();

III. Contributing

A. Issues

This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.

For help and questions about using this project, please open a GitHub issue.

B. Pull requests

  1. Fork the project.

  2. Create a topic branch from master.

  3. Make some commits to improve the project.

  4. Push this branch to your GitHub project.

  5. Open a Pull Request on GitHub.

  6. Discuss, and optionally continue committing.

IV. License

MIT © 明suhi