json-string-splitter
v1.0.0
Published
Split concatenated JSON strings
Downloads
147
Readme
JSON-String-Splitter
Split concatenated JSON strings.
Installation
Install with npm, or link the packaged file from your html:
npm install --save json-string-splitter
OR
wget https://raw.githubusercontent.com/Densaugeo/JSON-String-Splitter/master/build/Splitter.pkgd.min.js
Import
Supports node.js, AMD, and browser global modules.
In node or with browserify:
var splitter = require('json-string-splitter');
Or directly in html:
<script type="text/javascript" src="/your/folders/Splitter.pkgd.min.js"></script>
Usage
var splitter = require('json-string-splitter');
var pieces = splitter('{"foo":"bar"}{"more":"json"}{"partial":"json"');
console.log(pieces.jsons[0]); // '{"foo":"bar"}'
console.log(pieces.jsons[1]); // '{"more":"json"}'
console.log(pieces.remainder); // '{"partial":"json"'
License
LGPL