New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

firesync-node

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firesync-node

firesync is a library for seamless data synchronization between Firebase and your local data.

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

Firesync - Overview

Build Status Code Climate GitHub license dependencies version

NPM

firesync is a library for seamless data synchronization between Firebase and your local data. When a FiresyncObject or FiresyncArray is created this object is observed for changes. At the same time the FirebaseRef is also observed. When a change in the one end happens, the data is immediately synchronized to the other end, eliminating the need to explicitly subscribe to events in order to update objects.

Requirements

firesync runs equally well in browsers and in node. Since it uses Object.observe to watch for local changes a polyfill should be used in environments that do not support it.

Instalation and usage

bower

bower install firesync

<script src="bower_components/firesync/dist/firesync.js"></script>

nodejs

npm install firesync-node

var firesync = require('firesync-node');

API Reference

Classes

firesync

The entry point of firesync.

## External
FirebaseRef

FirebaseRef object

## firesync The entry point of firesync.

Kind: global class

firesync.FiresyncArray ⇐ FiresyncBase

An array which keeps its values synchronized with the remote. One should use the FiresyncArray methods to manipulate the values.

Kind: static class of firesync
Extends: FiresyncBase
Access: protected

firesyncArray.loaded() ⇒ boolean

Indicates whether the object has loaded its data from Firebase.

Kind: instance method of FiresyncArray

firesyncArray.ref() ⇒ FirebaseRef

Returns the ref set in the constructor

Kind: instance method of FiresyncArray

firesyncArray.detach()

Detaches from the subscribed events to the FirebaseRef

Kind: instance method of FiresyncArray

firesyncArray.set(val)

Applies a value to the object.

Kind: instance method of FiresyncArray

ParamType
valobject

Example

firebaseObject.set({value: 1});

"changed"

Fired the local object changes, regardless whether it is a result of direct local change or remote change.

Kind: event emitted by FiresyncArray
Example

firesyncObject.on('changed', function(){});

"loaded"

Fired when the initial value of the object is loaded from the remote.

Kind: event emitted by FiresyncArray
Example

firesyncObject.on('loaded', function(){});

"synced" (err)

Fired when the local object's value is sucesfully set to the remote.

Kind: event emitted by FiresyncArray

ParamTypeDescription
errErrorSynchronization error

Example

firesyncObject.on('synced', function(){});

firesync.FiresyncObject ⇐ FiresyncBase

An object which keeps its values synchronized with the remote.

Kind: static class of firesync
Extends: FiresyncBase
Access: protected

firesyncObject.loaded() ⇒ boolean

Indicates whether the object has loaded its data from Firebase.

Kind: instance method of FiresyncObject

firesyncObject.ref() ⇒ FirebaseRef

Returns the ref set in the constructor

Kind: instance method of FiresyncObject

firesyncObject.detach()

Detaches from the subscribed events to the FirebaseRef

Kind: instance method of FiresyncObject

firesyncObject.set(val)

Applies a value to the object.

Kind: instance method of FiresyncObject

ParamType
valobject

Example

firebaseObject.set({value: 1});

"changed"

Fired the local object changes, regardless whether it is a result of direct local change or remote change.

Kind: event emitted by FiresyncObject
Example

firesyncObject.on('changed', function(){});

"loaded"

Fired when the initial value of the object is loaded from the remote.

Kind: event emitted by FiresyncObject
Example

firesyncObject.on('loaded', function(){});

"synced" (err)

Fired when the local object's value is sucesfully set to the remote.

Kind: event emitted by FiresyncObject

ParamTypeDescription
errErrorSynchronization error

Example

firesyncObject.on('synced', function(){});

FirebaseRef

FirebaseRef object

Kind: global external
See: https://www.firebase.com/docs/web/api/firebase/child.html

License

The MIT License (MIT)

Copyright (c) 2015 Firesync

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 05 Jul 2015

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