# firebase-swiss

> Under Development

Latest version **0.5.0** (published 2022-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-swiss
pnpm add firebase-swiss
yarn add firebase-swiss
bun add firebase-swiss
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2022-05-02 |
| First published | 2019-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Thiyagaraj T |
| Maintainers | thiya |

## Links

- npm: https://www.npmjs.com/package/firebase-swiss
- Repository: https://github.com/tstreamDOTh/firebase-swiss
- Homepage: https://github.com/tstreamDOTh/firebase-swiss#readme
- Issues: https://github.com/tstreamDOTh/firebase-swiss/issues
- npm.io page: https://npm.io/package/firebase-swiss

## Dependencies (1)

- [cors](https://npm.io/package/cors.md) ^2.8.5

## Recent versions

- 0.5.0 (latest) — 2019-10-12
- 0.0.3 — 2019-09-08
- 0.0.1 — 2019-09-07

## README

# firebase-swiss

 <img src="https://res.cloudinary.com/ddbxzcb7k/image/upload/v1568999179/firebaseswiss-02_hy9whb.png" width="50">
 
[![Build Status](https://circleci.com/gh/LogRocket/redux-logger/tree/master.svg?style=svg)](https://circleci.com/gh/tstreamDOTh/firebase-swiss/tree/master)  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Table of contents

- [Install](#install)
- [Usage](#usage)
- [Recipes (Coming Soon)](#recipes)
- [Options (Coming Soon) ](#options)

## Install

Using Yarn

`yarn add firebase-swiss`

Using NPM

`npm i firebase-swiss`

## Usage

If you are totally new to Firebase or Firebase Cloud Functions then [get started here](https://firebase.google.com/docs/functions/get-started)

Once you have created your firebase projects and setup cloud functions, you can start creating your CRUD api's like the following by using simple configuration -

```javascript
// functions.js
const FireFunctions = require('firebase-swiss');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const cors = require('cors')({
  origin: true
});

admin.initializeApp(functions.config().firebase);

const firefunctions = new FireFunctions(admin.database());

exports.addApplicant = firefunctions.getFireFunction({
  type: 'CREATE',
  ref: 'applicants',
  extractFromBody: ['name', 'role'],
  enableCors: true
});

exports.getApplicantById = firefunctions.getFireFunction({
  type: 'READ',
  ref: 'applicants',
  enableCors: true
});

exports.updateApplicantById = firefunctions.getFireFunction({
  type: 'UPDATE',
  ref: 'applicants',
  extractFromBody: ['name', 'role'],
  enableCors: true
});

exports.deleteApplicantById = firefunctions.getFireFunction({
  type: 'DELETE',
  ref: 'applicants',
  enableCors: true
});

```

---
_Source: https://npm.io/package/firebase-swiss · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
