kanso/kanso — pull request #397 by mgmarino (2013-07-10 11:00:07+00:00)
Title: 'kanso upload' should handle multi-line strings

When uploading data using 'kanso upload', the parsing of the JSON string fails if the string contains a new line. e.g.:

mgmarino% cat tmp.json
{
"_id" : "'test'",
"astring" : "test

+1"
}
mgmarino% kanso upload -f tmp.json http://127.0.0.1:5984/test
Uploading docs to http://127.0.0.1:5984/test
Reading tmp.json
Error: SyntaxError: Unexpected token

at Object.parse (native)
at ParseStream.Native (/usr/local/lib/node_modules/kanso/lib/data- stream/ParseStream.js:78:26)

This can be difficult to input data into JSON that is multi-line (e.g. scripts, etc.) so these multi-line strings should be properly escaped.