Browse Source

Merge pull request #34 from webmaster128/webbrowser-readme

Add getting started notes for use in webbroser
master
Feross Aboukhadijeh 8 years ago
committed by GitHub
parent
commit
da5718e816
  1. 10
      README.md

10
README.md

@ -15,13 +15,15 @@ Sometimes encoding/decoding binary data in the browser is useful, and that is wh
With [npm](https://npmjs.org) do: With [npm](https://npmjs.org) do:
`npm install base64-js` `npm install base64-js` and `var base64js = require('base64-js')`
## methods For use in web browsers do:
`<script src="base64js.min.js"></script>`
`var base64 = require('base64-js')` ## methods
`base64` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. `base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
* `byteLength` - Takes a base64 string and returns length of byte array * `byteLength` - Takes a base64 string and returns length of byte array
* `toByteArray` - Takes a base64 string and returns a byte array * `toByteArray` - Takes a base64 string and returns a byte array

Loading…
Cancel
Save