Easy copy and move actions within a firebase database
I simply got tired of rewriting the same copy (and remove) code for every firebase project.
# with npmnpm install --save fireaction# with yarnyarn add fireaction
For browsers, use the build in
var Fireaction =// ...// require and setup firebase//...// get firebase database refconst ref = firebase// configure fireaction with firebase database refconst fireaction = ref// copy from one path to the other// async with either callbackfireaction// or promisefireaction
move methods can take in a third object argument instead of a callback:
const options = withKey: true
|withKey||boolean (true)||Copies parent key with value into destination path|
|override||boolean (false)||Overrides existing data in destination path|
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 npmnpm install# with yarnyarn
Then run build:
npm run build
NB: It is better to build using
npm start which will lint and test before building.
- Take a look at existing issues.
- Create fixes/updates.
- Write tests.
- Lint, run tests and build.
- Send detailed PR.
Licensed under MIT
Copyright (c) 2017 ghostffcode