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

flame-core

v1.0.1

Published

flame-core is a collection of Firebase services designed to simplify common tasks and make Firebase integration more efficient and enjoyable.

Readme

banner

flame-core

flame-core is a comprehensive npm package designed to simplify Firebase operations. It provides developers with modular services for managing Firebase authentication, database, and storage with minimal boilerplate code. By using flame-core, you can streamline common Firebase tasks, saving time and effort in your development process.

Table of Contents

  1. Overview ⇗
  2. Installation ⇗
  3. Features ⇗
  4. Modules ⇗
  5. Util ⇗s

Overview

flame-core abstracts Firebase functionalities into easy-to-use modules. Whether you're working on authentication, database operations, or file storage, flame-core provides a unified API to interact with Firebase services efficiently.

Why Use flame-core?

  • Simplified Firebase integration.
  • Modular design for easy scalability.
  • Reduces boilerplate code and development time.
  • Comprehensive methods for authentication, Firestore, and storage operations.
  • Well-documented APIs with clear examples.

Installation

  1. Install flame-core via npm:

    npm install flame-core
  2. Initialize Firebase using your configuration:

    import firebaseConfig from 'flame-core';
    
    firebaseConfig.initialize({
      apiKey: "your-api-key",
      authDomain: "your-auth-domain",
      projectId: "your-project-id",
      storageBucket: "your-storage-bucket",
      messagingSenderId: "your-messaging-sender-id",
      appId: "your-app-id",
    });

Features

Simplified Firebase Operations

  • Easy-to-use modules for Firebase authentication, database, and storage.
  • Support for common tasks like user sign-in, data retrieval, and file uploads.

Modular Architecture

  • Each service is encapsulated in a dedicated module, making it easier to manage and scale.

Improved Code Readability

  • Clear and consistent APIs reduce complexity and enhance maintainability.

Cross-Platform Compatibility

  • Fully compatible with web, mobile, and server-side applications.

Enhanced Security

  • Built-in support for Firebase security rules and token management.

Modules

FirebaseConfig

Handles the initialization of Firebase in your project.

Usage:

import firebaseConfig from 'flame-core';

firebaseConfig.initialize({
  apiKey: "your-api-key",
  authDomain: "your-auth-domain",
  projectId: "your-project-id",
  storageBucket: "your-storage-bucket",
  messagingSenderId: "your-messaging-sender-id",
  appId: "your-app-id",
});

FireAuthService

The FireAuthService module focuses on authentication-related methods. It provides a seamless way to manage user login, registration, password resets, and social sign-ins.

Authentication Example

import { fireAuthService } from 'flame-core';

const authService = fireAuthService();

(async () => {
  try {
    const loginResponse = await authService.login("[email protected]", "password123");
    console.log(loginResponse);
  } catch (error) {
    console.error("Login failed:", error);
  }
})();

Read detailed documentation ⇗


FireStoreDatabaseService

The FireStoreDatabaseService module simplifies Firestore database operations. Perform CRUD operations with intuitive methods.

Features:

  • Add, update, delete, and fetch data.
  • Query documents with ease.
  • Support for batch operations.

Firestore Example

import { fireStoreDatabaseService } from 'flame-core';

const dbService = fireStoreDatabaseService();

interface Users {
    id?: string,
    name: string,
    email: string,
    age: number,
    eligible: boolean,
    salary: 50000,
    // Additional fields...
}

(async () => {
  try {
    const data = await dbService.getAll<Users>("users", {
      options: {
        where: {
          age: 20,
          email: "[email protected]",
          name: "Nike",
          created_at: { $gte: "01-01-1900", $lte: "31-12-2000" },
          salary: {
            $gt: 1000,
          },
        },
        sort: [["created_at", "asc"]],
        limit: 10,
      },
    });
    console.log(data);
  } catch (error) {
    console.error("Error fetching document:", error);
  }
})();

Read detailed documentation ⇗


FireStorageService

The FireStorageService module abstracts Firebase Storage operations, enabling easy file uploads, downloads, and deletions.

Features:

  • Upload files with metadata.
  • Retrieve download URLs.
  • Delete stored files.
  • Monitor upload progress.

Storage Example

import { fireStorageService } from 'flame-core';

const storageService = fireStorageService();

(async () => {
  try {
    const downloadUrl = await storageService.uploadFile("images/profile.png", file);
    console.log("File uploaded successfully:", downloadUrl);
  } catch (error) {
    console.error("Error uploading file:", error);
  }
})();

Read detailed documentation ⇗


Utils

The Utils section contains helper modules that enhance functionality and simplify complex operations.

Task

The Task module provides a structured interface for defining and handling tasks, including filtering, sorting, and pagination. It also includes tools for constructing Firestore queries dynamically.

Key Features:

  • Define tasks with TaskOptions, supporting advanced query conditions like $lt, $gte, $in, and $arrCont.
  • Handle task responses with TaskResponse.
  • Manage errors using the TaskResponseError class.
  • Includes queryValidator to dynamically build Firestore queries.

Read detailed documentation ⇗


Validation

The Validation module includes functions to validate the structure and content of queries and ensure they adhere to the required format.

Key Features:

  • validateQuery: Validates the query object to ensure it is correctly formatted.
  • Integrated into Firestore query building for error-free dynamic queries.

Read detailed documentation ⇗

Contribute

We welcome contributions to make flame-core better! If you have ideas, suggestions, or want to report issues, feel free to open a pull request or create an issue on GitHub. Let’s build something amazing together! 🚀


Support the Developer

If you find this project helpful, consider buying me a coffee! Your support means the world. ☕ Buy Me A Coffee ⇗

Contact me

Linkedin: https://bit.ly/3GQJ7mB Website: https://abhijithpsubash.com/


Thank you for using flame-core! Happy coding! 😊