mirror of
https://github.com/nolanlawson/blob-util.git
synced 2025-12-08 19:46:19 +00:00
update readme with install instructions
[skip ci]
This commit is contained in:
parent
fbe16e845b
commit
99c06472d1
24
README.md
24
README.md
@ -27,20 +27,36 @@ It's also a good pairing with the attachment API in [PouchDB](http://pouchdb.com
|
||||
Install
|
||||
------
|
||||
|
||||
Via npm:
|
||||
### Using Webpack/Rollup/Babel/TypeScript/etc.
|
||||
|
||||
Install via npm:
|
||||
|
||||
```bash
|
||||
npm install blob-util
|
||||
```
|
||||
|
||||
ES modules are supported:
|
||||
ES module format:
|
||||
|
||||
```js
|
||||
import * as blobUtil from 'blob-util'
|
||||
blobUtil.canvasToBlob(canvas, 'image/png').then(/* ... */)
|
||||
```
|
||||
|
||||
Or:
|
||||
|
||||
```js
|
||||
import { canvasToBlob } from 'blob-util'
|
||||
canvasToBlob(canvas, 'image/png').then(/* ... */)
|
||||
```
|
||||
|
||||
Or as a script tag:
|
||||
CommonJS format:
|
||||
|
||||
```js
|
||||
var blobUtil = require('blob-util')
|
||||
blobUtil.canvasToBlob(canvas, 'image/png').then(/* ... */)
|
||||
```
|
||||
|
||||
### As a script tag
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/blob-util/dist/blob-util.min.js"></script>
|
||||
@ -620,4 +636,4 @@ Or to test locally in your browser of choice:
|
||||
|
||||
To build the API docs and insert them in the README:
|
||||
|
||||
npm run doc
|
||||
npm run doc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user