# fireaction

> Easy copy and move actions within a firebase database

Latest version **1.0.2** (published 2017-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install fireaction
pnpm add fireaction
yarn add fireaction
bun add fireaction
```

## 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 | 2017-10-23 |
| First published | 2017-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chimeremeze Ukah |
| Maintainers | ghostffcode |
| Keywords | firebase, actions, copy, move, json, read, write |

## Links

- npm: https://www.npmjs.com/package/fireaction
- Repository: https://github.com/ghostffcode/fireaction
- Homepage: https://github.com/ghostffcode/fireaction#readme
- Issues: https://github.com/ghostffcode/fireaction/issues
- npm.io page: https://npm.io/package/fireaction

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-10-23
- 1.0.1 — 2017-10-23
- 1.0.0 — 2017-10-23
- 0.9.0 — 2017-10-23

## README

fireaction
========
Easy copy and move actions within a firebase database

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/ghostffcode/fireaction.svg?branch=master)](https://travis-ci.org/ghostffcode/fireaction)

Why?
-------
I simply got tired of rewriting the same copy (and remove) code for every firebase project.

Installation
----------------
```bash
# with npm
npm install --save fireaction

# with yarn
yarn add fireaction
```

For browsers, use the build in `dist/fireaction.js`

Usage
--------
In nodejs:
```js
var Fireaction = require('fireaction')

// ...
// require and setup firebase
//...
// get firebase database ref
const ref = firebase.database().ref()

// configure fireaction with firebase database ref
const fireaction = new Fireaction(ref)

// copy from one path to the other
// async with either callback
fireaction.copy(src, dest, function (err, data) {/*  */})
// or promise
fireaction.copy(src, dest)
	.then(function (sourceData) {/* ... */})
```

Options
-----------
Fireaction `copy` and `move` methods can take in a third object argument instead of a callback:
```js
const options = { withKey: true }

fireaction(src, dest, options, callback)
```
| Option | Type (default) | Description |
| --- | --- | -- |
| withKey | boolean (**true**) | Copies parent key with value into destination path |
| override | boolean (**false**) | Overrides existing data in destination path |

### Running Tests
- `npm run lint`: runs the linter ([standard](http://standardjs.com/))
- `npm run unit`: runs the unit tests
- `npm test`: runs both the linter and the tests

### Creating a build for browser
Build is run by webpack, so install dependencies:
```bash
# with npm
npm install

# with yarn
yarn
```
Then run build:
```bash
npm run build
```
**NB**: It is better to build using `npm start` which will lint and test before building.

### Contributing
To contribute:
- Take a look at existing issues.
- Create fixes/updates.
- Write tests.
- Lint, run tests and build.
- Send detailed PR.

License
-------
Licensed under MIT

Copyright (c) 2017 [ghostffcode](https://github.com/ghostffcode)

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