couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [10/43] jiffy commit: updated refs/heads/upstream to 446e284
Date Mon, 13 Jul 2015 18:45:09 GMT
Expand the README to cover the API more clearly


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/commit/577d7e02
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/tree/577d7e02
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/diff/577d7e02

Branch: refs/heads/upstream
Commit: 577d7e023122e2f11a83b5a2df45e69eb826a6fe
Parents: e668a4d
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Jun 13 17:16:14 2014 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Fri Jun 13 17:17:20 2014 -0500

----------------------------------------------------------------------
 README.md | 40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/577d7e02/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 285e116..0681404 100644
--- a/README.md
+++ b/README.md
@@ -10,12 +10,11 @@ Usage
 -----
 
 Jiffy is a simple API. The only thing that might catch you off guard
-is that the return type of jiffy:encode/1 is an iolist even though it
-returns a binary most of the time.
+is that the return type of `jiffy:encode/1` is an iolist even though
+it returns a binary most of the time.
 
-A quick note on unicode. Jiffy only understands utf-8 in binaries. End
-of story. Also, there is a jiffy:encode/2 that takes a list of options
-for encoding. Currently the only supported option is `uescape`.
+A quick note on unicode. Jiffy only understands UTF-8 in binaries. End
+of story.
 
 Errors are raised as exceptions.
 
@@ -27,6 +26,37 @@ Errors are raised as exceptions.
     3> jiffy:encode(Doc).
     <<"{\"foo\":[\"bing\",2.3,true]}">>
 
+`jiffy:decode/1,2`
+------------------
+
+* `jiffy:decode(IoData)`
+* `jiffy:decode(IoData, Options)`
+
+The options for decode are:
+
+* `{bytes_per_iter, N}` where N &gt;= 0 - This controls the number of
+  bytes that Jiffy will process before yielding back to the VM. The
+  mechanics of this yield are completely hidden from the end user.
+
+`jiffy:encode/1,2`
+------------------
+
+* `jiffy:encode(EJSON)`
+* `jiffy:encode(EJSON, Options)`
+
+where EJSON is a valid representation of JSON in Erlang according to
+the table below.
+
+The options for encode are:
+
+* `uescape` - Escapes UTF-8 sequences to produce a 7-bit clean output
+* `pretty` - Produce JSON using two-space indentation
+* `force_utf8` - Force strings to encode as UTF-8 by fixing broken
+  surrogate pairs and/or using the replacement character to remove
+  broken UTF-8 sequences in data.
+* `{bytes_per_iter, N}` where N &gt;= 0 - This controls the number of
+  bytes that Jiffy will generate before yielding back to the VM. The
+  mechanics of this yield are completely hidden from the end user.
 
 Data Format
 -----------


Mime
View raw message