json-buffer
Advanced tools
Comparing version 2.0.5 to 2.0.6
{ | ||
"name": "json-buffer", | ||
"description": "", | ||
"version": "2.0.5", | ||
"description": "JSON parse & stringify that supports binary via bops & base64", | ||
"version": "2.0.6", | ||
"homepage": "https://github.com/dominictarr/json-buffer", | ||
@@ -20,3 +20,19 @@ "repository": { | ||
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"testling": { | ||
"files": "test/*.js", | ||
"browsers": [ | ||
"ie/8..latest", | ||
"firefox/17..latest", | ||
"firefox/nightly", | ||
"chrome/22..latest", | ||
"chrome/canary", | ||
"opera/12..latest", | ||
"opera/next", | ||
"safari/5.1..latest", | ||
"ipad/6.0..latest", | ||
"iphone/6.0..latest", | ||
"android-browser/4.2..latest" | ||
] | ||
} | ||
} |
@@ -5,2 +5,6 @@ # json-buffer | ||
[![build status](https://secure.travis-ci.org/dominictarr/json-buffer.png)](http://travis-ci.org/dominictarr/json-buffer) | ||
[![testling badge](https://ci.testling.com/dominictarr/json-buffer.png)](https://ci.testling.com/dominictarr/json-buffer) | ||
JSON mangles buffers by converting to an array... | ||
@@ -7,0 +11,0 @@ which isn't helpful. json-buffers converts to base64 instead, |
var test = require('tape') | ||
var _JSON = require('../') | ||
var bops = require('bops') | ||
@@ -10,4 +11,4 @@ function toJSON (o) { | ||
var examples = { | ||
simple: { foo: [], bar: {}, baz: new Buffer('some binary data') }, | ||
just_buffer: new Buffer('JUST A BUFFER'), | ||
simple: { foo: [], bar: {}, baz: bops.from('some binary data') }, | ||
just_buffer: bops.from('JUST A BUFFER'), | ||
all_types: { | ||
@@ -25,8 +26,8 @@ string:'hello', | ||
escape: { | ||
buffer: new Buffer('x'), | ||
string: _JSON.stringify(new Buffer('x')) | ||
buffer: bops.from('x'), | ||
string: _JSON.stringify(bops.from('x')) | ||
}, | ||
escape2: { | ||
buffer: new Buffer('x'), | ||
string: ':base64:'+ new Buffer('x').toString('base64') | ||
string: ':base64:'+ bops.to(bops.from('x'), 'base64') | ||
}, | ||
@@ -33,0 +34,0 @@ undefined: { |
4994
86
25