Skip to content

JSON parser capable of handling standard and newline-delimited JSON

Notifications You must be signed in to change notification settings

brandoncarl/newJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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 : ... }

About

JSON parser capable of handling standard and newline-delimited JSON

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published