newjson

0.5.1 • Public • Published

newJSON

JSON parser capable of handling standard and newline-delimited JSON

Installation

$ npm install newjson

Comments

  var newJSON = require('newjson');
  
  
  newJSON.parse(json);          // works
  newJSON.parse(newlineJSON);   // also works
  

This function converts the following:

	{ "field1": "value1", "field2": "value2", "field3": "value3" }
	{ "fieldA": "valueA", "fieldB": "valueB", "fieldC": "valueC" }

into:

	{
		record1:	{ "field1": "value1", "field2": "value2", "field3": "value3" },
		record2:	{ "fieldA": "valueA", "fieldB": "valueB", "fieldC": "valueC" }
	}

You can specify a "handle" by passing { handle : "myhandle" } as a second argument. e.g. newJSON.parse(newlineJSON, { handle : "myhandle" } => { myhandle1 : ... }

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i newjson

      Weekly Downloads

      0

      Version

      0.5.1

      License

      MIT

      Last publish

      Collaborators

      • brandoncarl