1.1.3-beta • Published 4 years ago

realbase v1.1.3-beta

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Realbase package is currently in beta, and may contain bugs. You can report bugs/issues by clicking here.

realbase is a simple wrapper for Firebase SDK that helps you to writing, reading and deleting data from your realtime database. You can easy use this wrapper by only using your admin credentials, and after just use the functions available in this wrapper. Y'can see the docs below:

How to connect

const realbase = require('realbase');
const credentials = require('./credentials.json'); // Your credentials file. firebase will automatically generate one for you.

const db = new realbase(credentials, 'https://<database_name>.firebaseio.com/'); // In parameter <database_name> set your database code in.

Using this code above, you can connect/authorize your Firebase account in the wrapper to use the functions.

Documentation

Create a path with values provided by the data.

db.create('users');

Set a value provided by data to the provided path.

db.set('users/talrustico', { id: '7129572198' });

Update a value from the path.

db.update('users/talrustico', { id: '7129572198' });

This function may not work correctly.

Push a value to a path with the value provided by data.

db.push('users', { name: 'talrustico' });

Delete a path from the database.

db.delete('users');

Get values from provided path.

db.get('users/talrustico');

License

This project is under the MIT License.