# firebase-functions-instance

> Methods and Helpers for Firebase cloud functions, Firestore, RTDB, and more

Latest version **1.0.2** (published 2018-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-functions-instance
pnpm add firebase-functions-instance
yarn add firebase-functions-instance
bun add firebase-functions-instance
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-05-26 |
| First published | 2018-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 36.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Siriwat Kunaporn |
| Maintainers | siriwatkunaporn |
| Keywords | firebase |

## Links

- npm: https://www.npmjs.com/package/firebase-functions-instance
- Homepage: http:
- npm.io page: https://npm.io/package/firebase-functions-instance

## Dependencies (6)

- [cors](https://npm.io/package/cors.md) ^2.8.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [express](https://npm.io/package/express.md) ^4.16.3
- [firebase](https://npm.io/package/firebase.md) ^5.0.4
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^5.11.0
- [firebase-functions](https://npm.io/package/firebase-functions.md) ^0.9.1

## Recent versions

- 1.0.2 (latest) — 2018-05-26
- 1.0.1 — 2018-05-22

## README

# Firebase Functions with Babel config to target the correct Execution Environment

Use Babel to target the correct execution environment for Cloud Functions for
Firebase and use modern languages features (ES6+) to develop.

Here is the accompanying
[Medium post](https://medium.com/@jthegedus/es6-in-cloud-functions-for-firebase-2-415d15205468).

## Project Layout Description

I suggest developing your Cloud Functions in the `src/functions/` directory and output everything to a `dist/functions/` folder. By using a single root `package.json` we remove the need for maintaining and possibly merging two or more for the Functions themselves and other code, like a frontend app.

Use `@babel/core`, `@babel/cli` and `@babel/preset-env` with some npm scripts to compile to the Cloud Functions server runtime of NodeJS v6.11.5. The output directory, `dist/functions/` is created on compilation in the deploy step (yarn deploy).

Firebase predeploy scripts are used in the `firebase.json` to coordinate which npm scripts get called before deploying to ensure everything is built.

## Download & Install

```shell
# Clone this dir
curl https://codeload.github.com/jthegedus/blog-code/tar.gz/master | tar -xz --strip=1 blog-code-master/firebase-functions-es6-babel
cd firebase-functions-es6-babel
# Install
yarn
```

## Login to the Firebase CLI

If you're using `firebase-tools` globally, then skip to the [_Deploy to Firebase_](#deploy-to-firebase) step.

```shell
yarn fblogin
```

## Local Testing

```shell
yarn serve
```

## Deploy to Firebase

Update `.firebaserc` to use your Firebase project id.

```shell
yarn deploy
```

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