blackboard-firebase-storage
v1.0.6
Published
Send upload file firebase-storage from Node.js โ easy as Peeled bananas! ๐ย ย โฌ๏ธ ๐
Downloads
7
Maintainers
Readme
blackboard-firebase-storage
Send upload file firebase-storage from Node.js โ easy as Peeled bananas! ๐ย ย โฌ๏ธ ๐
Installation
$ npm install blackboard-firebase-storage
or
$ yarn add blackboard-firebase-storage
Importing
// Using Node.js `require()`
const brg = require('blackboard-firebase-storage');
Overview
Connecting to Firebase
First, we need to define a connection firebase service. brg.connect
brg.connect({
apiKey: '<your-api-key>',
authDomain: '<your-auth-domain>',
databaseURL: '<your-database-url>',
storageBucket: '<your-storage-bucket-url>'
})
Upload File
brg.uploadFile("path","name",file).then(snap => {
console.log(snap)
});
Upload String File
brg.uploadString("path","name","url_file || base64").then(snap => {
console.log(snap)
});
Get File
brg.getFile("path","name").then(snap => {
console.log(snap)
});
Get Url
brg.getUrl("path","name").then(snap => {
console.log(snap)
});
Remove
brg.remove("path","name").then(snap => {
console.log(snap)
});