json-string-splitter

Split concatenated JSON strings


Keywords
json
License
LGPL-2.1+
Install
npm install json-string-splitter@1.0.0

Documentation

JSON-String-Splitter

Split concatenated JSON strings.

License: LGPL View on npm Build Status

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