https://github.com/tiaanduplessis/blob-to-base64
Convert Blob to base64
https://github.com/tiaanduplessis/blob-to-base64
base64 blob filereader
Last synced: 11 months ago
JSON representation
Convert Blob to base64
- Host: GitHub
- URL: https://github.com/tiaanduplessis/blob-to-base64
- Owner: tiaanduplessis
- License: mit
- Created: 2017-07-26T22:38:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-12T23:47:32.000Z (about 6 years ago)
- Last Synced: 2025-06-23T17:16:11.359Z (about 1 year ago)
- Topics: base64, blob, filereader
- Language: HTML
- Size: 363 KB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
blob-to-base64
Convert Blob to base64
Table of Contents
Table of Contents
## Install
[](https://greenkeeper.io/)
```sh
$ npm install blob-to-base64
# OR
$ yarn add blob-to-base64
```
## Usage
```js
const blobToBase64 = require('blob-to-base64')
const button = document.querySelector('.button')
button.addEventListener('click', function (event) {
const blob = document.querySelector('.input').files[0]
blobToBase64(blob, function (error, base64) {
if (!error) {
document.querySelector('.result').innerHTML = base64
}
})
})
```
## Contributing
Contributions are welcome!
1. Fork it.
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
Or open up [a issue](https://github.com/tiaanduplessis/blob-to-base64/issues).
## License
Licensed under the MIT License.