Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fireaction

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fireaction

Easy copy and move actions within a firebase database

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

fireaction

Easy copy and move actions within a firebase database

JavaScript Style Guide Build Status

Why?

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

Installation

# with npm
npm install --save fireaction

# with yarn
yarn add fireaction

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

Usage

In nodejs:

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:

const options = { withKey: true }

fireaction(src, dest, options, callback)
OptionType (default)Description
withKeyboolean (true)Copies parent key with value into destination path
overrideboolean (false)Overrides existing data in destination path

Running Tests

  • npm run lint: runs the linter (standard)
  • 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:

# with npm
npm install

# with yarn
yarn

Then run build:

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

Keywords

FAQs

Package last updated on 23 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc