1.1.1 • Published 2 years ago

@taishikato/firebase-storage-uploader v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

@taishikato/firebase-storage-uploader

A library to upload a image on Firebase Storage📸

npm (scoped) npm bundle size (scoped)

Install

With npm

$ npm i @taishikato/firebase-storage-uploader

With yarn

$ yarn add @taishikato/firebase-storage-uploader

Usage

// CommonJS
const uploadImage = require('@taishikato/firebase-storage-uploader').default;
// ES6
import uploadImage from '@taishikato/firebase-storage-uploader';

import firebase from 'firebase/app'
import 'firebase/storage'
if (!firebase.apps.length) {
  firebase.initializeApp({
    apiKey: <apiKey>,
    authDomain: <authDomain>,
    databaseURL: <databaseURL>,
    projectId: <projectId>,
    storageBucket: <storageBucket>,
    messagingSenderId: <messagingSenderId>,
    appId: <appId>,
    measurementId: <measurementId>
  })
}

const imageUrl = 'data:image/jpeg;base64,/9j/4gIcSUNDX1BST0ZJTEUA…'

uploadImage('users/John.png', imageUrl, firebase).then(result => {
  console.log(result) // You can access to your image file via this URL of firebase storage
})
1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago