Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/InCuca/ic-firebase-uploader

This component is a multi-file uploader for firebase
https://github.com/InCuca/ic-firebase-uploader

file firebase firebase-storage multi-upload upload uploader vue vue2

Last synced: about 2 months ago
JSON representation

This component is a multi-file uploader for firebase

Awesome Lists containing this project

README

        

# ic-firebase-uploader
[![Travis](https://img.shields.io/travis/InCuca/ic-firebase-uploader/master.svg)](https://travis-ci.org/InCuca/ic-firebase-uploader/branches)

> This component is a multi-file uploader for firebase

## Installation

### Using yarn

`yarn add ic-firebase-uploader`

### Using npm

`npm i --save ic-firebase-uploader`

### ES6 Modules / CommonJS

```js
import IcFirebaseUploader from 'ic-firebase-uploader';
import 'ic-firebase-uploader/dist/ic-firebase-uploader.min.css';

Vue.component('ic-firebase-uploader', IcFirebaseUploader);
```

### UMD

```html

Vue.component('ic-firebase-uploader', window.IcFirebaseUploader);

```

## Usage

```js
const firebase = require('firebase')

const config = {
apiKey: "secret",
projectId: "app-id",
storageBucket: "app-id.appspot.com",
}

function getStorage() {
firebase.initializeApp(config)
return firebase.storage()
}

function getFileName(file) {
return file.name + Math.floor(Math.random() * 1000)
}

function onUpload({doUpload}) {
doUpload();
}

function onDelete({doDelete}) {
doDelete();
}
```

```html

```

## Demo and Docs

`npm run serve`

## Build

Build configuration is located in the `poi.config.js` file, to build just run: `npm run build`, it will build to `cjs` and `umd` directories.

## Tests

This template uses karma with chai by default, you can change test settings in poi.config.js

`npm run test`
`npm run test:watch`
`npm run test:cov`

## License

This project is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)