Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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)
Loading