2014-10-25 11:22:57 -04:00
2014-10-24 22:23:49 -04:00
2014-10-25 11:22:57 -04:00
2014-10-04 22:40:02 -04:00
2014-10-04 22:40:02 -04:00
2014-10-04 22:40:02 -04:00
2014-10-04 22:40:02 -04:00
2014-10-24 15:01:49 -04:00
2014-10-25 11:22:57 -04:00
2014-10-24 21:42:28 -04:00
2014-10-24 21:53:11 -04:00
2014-10-24 15:01:49 -04:00

blob-util

Build Status

You know what's cool? HTML5 Blobs.

You know what's hard to work with? Yeah, you guessed it.

If you just want to work with binary data in the browser and not pull your hair out, then this is the library for you.

blob-util offers various utilities for transforming Blobs between different formats (base 64, data URL, image), and it works cross-browser.

It's also a good pairing with the attachment API in PouchDB.

Usage

Grab it from the dist/ folder above, or npm:

npm install blob-util

Or Bower:

bower install blob-util

Then stick it in your HTML:

<script src="blob-util.js"></script>

Now you have a window.blobUtil object that contains the API. Or if you don't like globals, you can use Browserify.

Building

npm install
npm run build

Your plugin is now located at dist/pouchdb.mypluginname.js and dist/pouchdb.mypluginname.min.js and is ready for distribution.

Testing

In the browser

Run npm run dev and then point your favorite browser to http://127.0.0.1:8001/test/index.html.

The query param ?grep=mysearch will search for tests matching mysearch.

Automated browser tests

You can run e.g.

CLIENT=selenium:firefox npm test
CLIENT=selenium:phantomjs npm test

This will run the tests automatically and the process will exit with a 0 or a 1 when it's done. Firefox uses IndexedDB, and PhantomJS uses WebSQL.

Description
Cross-browser utils for working with binary Blobs
Readme Apache-2.0 31 MiB
Languages
TypeScript 62.4%
JavaScript 37.6%