Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent b4b6fdb commit 2175c1f0f4ea523bdb66e0767c7be4f80078d6a3 @vjeux committed Dec 2, 2011
Showing with 37 additions and 0 deletions.
  1. +37 −0 README.md
View
@@ -149,6 +149,43 @@ file: {
```
+Get Started
+=======
+
+**NodeJS**: Just use ```npm``` to install ```jParser``` and you are set :)
+
+```bash
+npm install jParser
+```
+
+```javascript
+var fs = require('fs');
+var jParser = require('jParser');
+
+fs.readFile('file.bin', function (err, data) {
+ var parser = new jParser(data, {
+ magic: ['array', 'uint8', 4]
+ });
+ console.log(parser.parse('magic'));
+});
+```
+
+**Browser**: I've [patched jQuery](https://github.com/vjeux/jDataView/blob/master/jquery/jquery-patch.txt) to allow to download binary files using the best binary format. You include this patched jQuery, jDataView and jParser and you are set :)
+
+```html
+<script src="https://raw.github.com/vjeux/jDataView/master/jquery/jquery-1.7.1-binary-ajax.js"></script>
+<script src="https://raw.github.com/vjeux/jDataView/master/src/jdataview.js"></script>
+<script src="https://raw.github.com/vjeux/jParser/master/src/jparser.js"></script>
+
+<script>
+$.get('file.bin', function (data) {
+ var parser = new jParser(data, {
+ magic: ['array', 'uint8', 4]
+ });
+ console.log(parser.parse('magic'));
+}, 'dataview');
+</script>
+```
Caveats
=======

0 comments on commit 2175c1f

Please sign in to comment.