{"_id":"vstream-json-parser","_rev":"34-6dda98deef5d8e8ef3ef6f9dda3ee9a4","name":"vstream-json-parser","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"vstream-json-parser","version":"1.0.0","license":"MIT","_id":"vstream-json-parser@1.0.0","maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"homepage":"https://github.com/joyent/node-vstream-json-parser","bugs":{"url":"https://github.com/joyent/node-vstream-json-parser/issues"},"dist":{"shasum":"c8c374fba9f31ecee7056213da7e4d72cd628ae4","tarball":"https://registry.npmjs.org/vstream-json-parser/-/vstream-json-parser-1.0.0.tgz","integrity":"sha512-rlFvm7dNo8dLgnnZ22x2ZkIEdQDrQHW2JR0SNFcMVX7L4OZVc0fUcyZTYgPALjqTPQ7fGuLakagQvH8QJ5PTGw==","signatures":[{"sig":"MEUCIQC+UQphgXLWAQ6xP6tAyfgF8F4aGYAHsJOEB98I1jiquwIgC5wdw4Wy0fQEG456H5U35XRaPF5sffhtVg8WEpag3nM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/vstream-json-parser.js","_from":".","_shasum":"c8c374fba9f31ecee7056213da7e4d72cd628ae4","gitHead":"6c7f52cf23117fd1722948fa007974ca6f7fa092","scripts":{"test":"make test"},"_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"repository":{"url":"git://github.com/joyent/node-vstream-json-parser.git","type":"git"},"_npmVersion":"1.4.21","description":"vstream-based JSON parser stream","directories":{},"dependencies":{"jsprim":"1.0.0","vstream":"0.1.0"},"devDependencies":{"lstream":"0.0.4"}},"1.0.1":{"name":"vstream-json-parser","version":"1.0.1","license":"MIT","_id":"vstream-json-parser@1.0.1","maintainers":[{"name":"todd.whiteman","email":"todd.whiteman@joyent.com"},{"name":"kusor","email":"kusorbox@gmail.com"},{"name":"wyatt","email":"wpreul@gmail.com"},{"name":"michael.hicks","email":"michael.hicks@joyent.com"},{"name":"bahamat","email":"bahamat@digitalelf.net"},{"name":"chudley","email":"aguycalledrichard@gmail.com"},{"name":"tchameroy","email":"tyler.chameroy@joyent.com"},{"name":"dbuell","email":"dayne.buell@joyent.com"},{"name":"trentm","email":"trentm@gmail.com"},{"name":"dap","email":"dap@cs.brown.edu"},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"arekinath","email":"alex@cooperi.net"},{"name":"melloc","email":"cody.mello@joyent.com"},{"name":"kellymclaughlin","email":"kelly.mclaughlin@joyent.com"}],"homepage":"https://github.com/joyent/node-vstream-json-parser#readme","bugs":{"url":"https://github.com/joyent/node-vstream-json-parser/issues"},"dist":{"shasum":"9d1cb891ee67e3482330286b8bfa3d181bee0d7e","tarball":"https://registry.npmjs.org/vstream-json-parser/-/vstream-json-parser-1.0.1.tgz","fileCount":12,"integrity":"sha512-5RairygwdETULDPYOYbzZXwwZhnY7yrCRLY1RgmZ4UyxkEVpRrwnrIKFCCzt7wKK4MyXo9gGC5FA+EXcrfn6Ug==","signatures":[{"sig":"MEUCICey0Ehow6BSjunTVvAJn0pOop/rizEwuFO0OAQO1NSGAiEAktxMQS821LLsTl5b7moiOan0C/v1Pc72He9QAiw9h00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3AEKCRA9TVsSAnZWagAAhw0P+QEFUXLAQ1SXNjqsTg1k\n+ZUJyxBUg9UaebhU/jV+ifVm0R9Q4X/eHNlHMgSCrHwZWW2/z4Waew+hUshe\nNJa4SsoKj2DqyFPxpNTCbYd2hg3s9vA5crU/LvoubW1AQCV3SoULUUloCbhM\nRyVxyt2LYadQofkjd4ad7U7KI4r0ENBcP572O+0kDhFVGiHec8KMGKOwOUsY\nMTlODMc6du2GxcpS07mZ9GIoasj5sFSYXhZOOBhtU57Ty2N+pGkPRvwF8YeT\nH3OXPtiFDoEqdrqpZ9tKSHs6Q3Q9kbOcTg6yemNQ4MiIEVWp6o+ETxR6WTmW\n9E4pOWkjNErORJKnivKRcUR2xJW401HeAlainZnljlo20gt+oIGTFCP9OAvY\nKn7OHRcCp//mW5m/3O6WDKv00GFdOiYZWvGRLpOtiM/Pscm/mpYTFB9v8gz4\nw/kEvGycFT2dMMdJ7rpjqaLleqvpkwPMOTmJX6eXpSdTYcaLWnrvpskH73lE\n5SMlPE1gJvEGhR+St8KqH+oefQvQbk4UH5p+EjvekHnH5t+qwbG7GDrm14z1\nG3E5rI5zCjgPPLkVtD6yLDSnm+rlO2GAHlRNWR5Vw1W51UDI8bvgkXqv5jtf\n4ZB6dUA9fnYI4C22sLnOq22FwgJK7p+B1q82PHgVgmLccHNYNVtrm5s4vK9P\nBwQa\r\n=C1S3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/vstream-json-parser.js","gitHead":"dcb992fde49fb1ff1de124ee87d748c933638056","scripts":{"test":"make test"},"_npmUser":{"name":"bahamat","email":"bahamat@digitalelf.net"},"repository":{"url":"git+https://github.com/joyent/node-vstream-json-parser.git","type":"git"},"_npmVersion":"6.14.13","description":"vstream-based JSON parser stream","directories":{},"_nodeVersion":"12.22.7","dependencies":{"jsprim":"1.0.0","vstream":"0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"lstream":"0.0.4"},"_npmOperationalInternal":{"tmp":"tmp/vstream-json-parser_1.0.1_1635957636141_0.5768910838006256","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-09-02T20:53:32.589Z","modified":"2025-11-26T18:16:12.634Z","1.0.0":"2015-09-02T20:53:32.589Z","1.0.1":"2021-11-03T16:40:36.373Z"},"bugs":{"url":"https://github.com/joyent/node-vstream-json-parser/issues"},"license":"MIT","homepage":"https://github.com/joyent/node-vstream-json-parser#readme","repository":{"url":"git+https://github.com/joyent/node-vstream-json-parser.git","type":"git"},"description":"vstream-based JSON parser stream","maintainers":[{"email":"todd.whiteman@joyent.com","name":"todd.whiteman"},{"email":"kusorbox@gmail.com","name":"kusor"},{"email":"michael.hicks@joyent.com","name":"michael.hicks"},{"email":"bahamat@digitalelf.net","name":"bahamat"},{"email":"Tr@visPaul.me","name":"tpaul"},{"email":"danmcd@edgecast.io","name":"kebesays"},{"email":"trentm@gmail.com","name":"trentm"},{"email":"dap@cs.brown.edu","name":"dap"},{"email":"josh@sysmgr.org","name":"jclulow"},{"email":"alex@cooperi.net","name":"arekinath"},{"email":"melloc@writev.io","name":"melloc"},{"email":"kelly.mclaughlin@joyent.com","name":"kellymclaughlin"}],"readme":"<!--\n    This Source Code Form is subject to the terms of the Mozilla Public\n    License, v. 2.0. If a copy of the MPL was not distributed with this\n    file, You can obtain one at http://mozilla.org/MPL/2.0/.\n-->\n\n<!--\n    Copyright (c) 2015, Joyent, Inc.\n-->\n\n# vstream-based JSON parser\n\n## Synopsis\n\n    var JsonParserStream = require('vstream-json-parser');\n    var stream = new JsonParserStream();\n    stream.end('{ \"hello\": \"world\" }');\n    console.error(stream.read());\n\nThis prints:\n\n    { hello: 'world' }\n\nFor a more complete example, see below.\n\n## Description\n\nThis module provides a Node _object-mode_ Transform stream.\n\n**Inputs:** chunks of UTF8 text, each representing a JSON object.  The common\nuse-case is to parse newline-separated JSON objects.  You can do this by piping\nyour input to an [lstream](https://github.com/tjfontaine/node-lstream) and\npiping that to this stream.  There's an example below.\n\n**Outputs:** plain JavaScript objects, the result of parsing each input as JSON.\n\n**Error handling:** This module follows the Joyent Best Practices for [Error\nHandling in Node.js](https://www.joyent.com/developers/node/design/errors).\nThere are two operational errors associated with this stream:\n\n*  an input object could not be parsed as JSON\n*  an input object was parsed and had the value `null`\n\nThese are _not_ emitted as `error` events, since they would be fatal to the\nstream.  Instead, these are emitted as a warning via the\n[vstream](https://github.com/joyent/node-vstream) interface.  See the example\nbelow for details.\n\nThe only supported constructor argument is an optional object of stream options.\nThe values in this object are passed to the Node `Stream` constructor, so this\nallows you to set things like `highWaterMark`.  The `objectMode` property is\nalways overridden to `true`.\n\n**Runtime notes**: This class executes transformations synchronously, but never\nprocesses more than one input during a single tick in order to preserve liveness\n(i.e., to allow other events to be processed, even when a lot of inputs have\nbeen read).\n\nThe default `highWaterMark` is `0`, meaning that the only data buffered are\nobjects currently being processed.  This class can be used to process large\nstreams of data with a small amount of memory usage.\n\nObjects with value `null` are ignored, because Node does not provide a way to\nemit them, nor do readers have a way of receiving them.  (Emitting `null` would\nend the stream, and getting `null` from `read()` means end-of-stream.)\n\n\n## Full example: command-line program to extract fields from JSON objects\n\nFor a full example, see `examples/extracttime.js`.  This example is a very\nsimple tool that reads newline-separated JSON on stdin, extracts the field\n\"time\" from each one, and prints it out.  If you were really doing this, you'd\nprobably want to check out [json](https://github.com/trentm/json).  But this\nexample includes error handling and is quite short.\n\nAs sample input, try passing it a\n[bunyan](https://github.com/trentm/node-bunyan) log.  Or try a file like this:\n\n    $ cat input \n    { \"time\": \"now\" }\n    { \"time\": null }\n    { \"time\n    { \"time\": \"today\" }\n    { \"notime\": \"tomorrow\" }\n    { \"time\": \"yesterday\" }\n\nOn that input, it emits this on stdout:\n\n    now\n    today\n    yesterday\n\nand this on stderr:\n\n    warn: extractor input 2 from json parser input 2: value { time: null }: object's \"time\" is null\n    warn: json parser input 3: value '{ \"time': Unexpected token t\n    warn: extractor input 4 from json parser input 5: value { notime: 'tomorrow' }: object has no \"time\"\n\n","readmeFilename":"README.md"}