Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added example

  • Loading branch information...
commit e61213967ced0a198cd57a1ed719f928b8fd9edb 1 parent ca019f0
@unixpickle authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 JSKBKit/example.js
View
16 JSKBKit/example.js
@@ -0,0 +1,16 @@
+/** This is how encoding/decoding might look **/
+
+require('./node_include.js');
+
+// encode
+var enc = new KBEncode(new KBBuffer(1));
+enc.encode([1337, -3.14, -65536, 'test', false, null, {'hi': 10}]);
+
+// get encoded buffer for decoding
+var buff = enc.buffer;
+buff.offset = 0;
+
+// decode
+var dec = new KBDecode(buff);
+var decoded = dec.decode();
+console.log(decoded);
Please sign in to comment.
Something went wrong with that request. Please try again.