Skip to content

Add usage description for HTML pages #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Browser-buffer.js
An attempt at mimicing node.js's Buffer API in the browser using typed arrays. This project uses a lot of code from node.js's (lib/buffer.js)[https://github.com/joyent/node/blob/master/lib/buffer.js]. This library still needs a lot of work both to get it running across the board and to clean up some of the pollution it puts on the UInt8Array prototype.
An attempt at mimicing node.js's Buffer API in the browser using typed arrays. This project uses a lot of code from node.js's [lib/buffer.js](https://github.com/joyent/node/blob/master/lib/buffer.js). This library still needs a lot of work both to get it running across the board and to clean up some of the pollution it puts on the UInt8Array prototype.

# Usage:
```javascript
<script src="src/browser-buffer.js" /></script>

<script>
var value = new Buffer('test');
console.log(value.toString());

value = new Buffer('test', 'utf8');
console.log(value.toString());
</script>
```

## (lightly) Tested in:
* Chrome 18 (beta) (Ubuntu)
Expand All @@ -10,4 +23,9 @@ An attempt at mimicing node.js's Buffer API in the browser using typed arrays. T
1. hex
2. binary
3. base64 (possibly use btoa/atob?)
4. ucs-2
4. ucs-2

## Online Tests from /test/ folder
* [test](https://username1565.github.io/browser-buffer/test/test.htm)
* [benchmark (wait some time)](https://username1565.github.io/browser-buffer/test/benchmark.htm)
* [debug (no display anything)](https://username1565.github.io/browser-buffer/test/debug.htm)