{"id":22531579,"url":"https://github.com/timkuijsten/node-ld-jsonstream","last_synced_at":"2025-04-09T16:54:51.323Z","repository":{"id":23296621,"uuid":"26655856","full_name":"timkuijsten/node-ld-jsonstream","owner":"timkuijsten","description":"Simple and secure newline delimited JSON stream parser","archived":false,"fork":false,"pushed_at":"2025-02-01T14:51:15.000Z","size":37,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:05:49.321Z","etag":null,"topics":["line-delimited-json","ndjson","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ld-jsonstream","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timkuijsten.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-14T20:19:34.000Z","updated_at":"2025-02-01T14:51:11.000Z","dependencies_parsed_at":"2024-06-19T06:16:42.309Z","dependency_job_id":"7044ddd4-17ad-476f-8937-fbbeefec8a1c","html_url":"https://github.com/timkuijsten/node-ld-jsonstream","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.2068965517241379,"last_synced_commit":"2aa32571ae6d56bfe276c1b367f592a0ff70b632"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkuijsten%2Fnode-ld-jsonstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkuijsten%2Fnode-ld-jsonstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkuijsten%2Fnode-ld-jsonstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkuijsten%2Fnode-ld-jsonstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timkuijsten","download_url":"https://codeload.github.com/timkuijsten/node-ld-jsonstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247749976,"owners_count":20989712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["line-delimited-json","ndjson","nodejs"],"created_at":"2024-12-07T08:08:12.294Z","updated_at":"2025-04-09T16:54:51.316Z","avatar_url":"https://github.com/timkuijsten.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LDJSONStream\n\nParse a binary stream of stringified new line separated JSON objects and write\nto output. Implements a Transform stream.\n\nFeatures:\n* [LDJSON](https://en.wikipedia.org/wiki/Line_Delimited_JSON) support\n* [NDJSON](http://ndjson.org/) support\n* simple and dependency free\n* easy to audit\n\n\n## Example\n\nA simple filter that logs all objects that have the *name* *baz*:\n\n```js\nconst Writable = require('stream').Writable;\nconst LDJSONStream = require('ld-jsonstream');\n\nvar ls = new LDJSONStream({ objectMode: true });\n\nls.pipe(new Writable({\n  objectMode: true,\n  write: function(obj, encoding, cb) {\n    if (obj.name === 'baz') {\n      console.log(obj);\n    }\n    cb();\n  }\n}));\n\nls.write('{ \"name\" : \"bar\" }\\n{ \"name\" : \"baz\" }\\n');\n```\n\nA more practical use case would be to read from stdin with something like:\n`process.stdin.pipe(ls)`.\n\n\n## Installation\n\n```sh\n$ npm install ld-jsonstream\n```\n\n\n## API\n\n### LDJSONStream([opts])\n* [opts] {Object} object containing optional parameters\n\nopts:\n* maxDocLength {Number, default 16777216} maximum JSON document size in bytes\n* maxDocs {Number, default infinite} maximum number of documents to receive\n* maxBytes {Number, default infinite} maximum number of bytes to receive\n* readableObjectMode {Boolean, default false} Sets objectMode for the readable side of\n  the stream. Note: the writable side of the stream can never be in object mode. If\n  you have such a case, you don't need this module.\n* objectMode {Boolean, default false} alias for readableObjectMode\n\nevents:\n* \"data\" {Object}  emits one object at a time\n* \"end\"  stream end\n\n### this.bytesRead\n* {Number} total number of bytes read\n\n\n## Tests\n\n```sh\n$ npm test\n```\n\n\n## License\n\nISC\n\nCopyright (c) 2014, 2015, 2016, 2019 Tim Kuijsten\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkuijsten%2Fnode-ld-jsonstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkuijsten%2Fnode-ld-jsonstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkuijsten%2Fnode-ld-jsonstream/lists"}