From 22fd3a7ad1741b81d3529769c285f88316d99702 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 20 May 2018 17:06:46 -0700 Subject: [PATCH] update readme [skip ci] --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a11457e..2d1839c 100644 --- a/README.md +++ b/README.md @@ -27,24 +27,35 @@ It's also a good pairing with the attachment API in [PouchDB](http://pouchdb.com Install ------ -Download it from the `dist/` folder above, or use NPM: +Via npm: ```bash -$ npm install blob-util +npm install blob-util ``` -Then stick it in your HTML: +ES modules are supported: + +```js +import { canvasToBlob } from 'blob-util' +canvasToBlob(canvas, 'image/png').then(/* ... */) +``` + +Or as a script tag: ```html - + ``` -Now you have a `window.blobUtil` object. Or if you don't like globals, you can use Browserify. +Then it's available as a global `blobUtil` object: + +```js +blobUtil.canvasToBlob(canvas, 'image/png').then(/* ... */) +``` Browser support ----- -As of v2.0.0, a built-in `Promise` polyfill is no longer provided. Assuming you provide a Promise +As of v2.0.0, a built-in `Promise` polyfill is no longer provided. Assuming you provide a `Promise` polyfill, the supported browsers are: * Firefox