{"id":17749480,"url":"https://github.com/oresoftware/json-parser","last_synced_at":"2026-02-10T08:31:54.042Z","repository":{"id":57134201,"uuid":"149323182","full_name":"ORESoftware/json-parser","owner":"ORESoftware","description":"Node.js transform stream - takes JSON and parses to objects.","archived":false,"fork":false,"pushed_at":"2019-10-07T21:14:49.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T16:54:41.989Z","etag":null,"topics":["nodejs","stream","transform-stream","transform-streams"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ORESoftware.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T16:58:31.000Z","updated_at":"2022-09-29T06:30:18.000Z","dependencies_parsed_at":"2022-09-04T05:35:00.977Z","dependency_job_id":null,"html_url":"https://github.com/ORESoftware/json-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ORESoftware/json-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fjson-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fjson-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fjson-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fjson-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ORESoftware","download_url":"https://codeload.github.com/ORESoftware/json-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fjson-parser/sbom","scorecard":{"id":103733,"data":{"date":"2025-08-11","repo":{"name":"github.com/ORESoftware/json-parser","commit":"0a8199d94d5b1454978ef523036106b2fd3a597d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: scripts/npm/install.sh:13","Warn: npmCommand not pinned by hash: scripts/travis/before_install.sh:5","Warn: npmCommand not pinned by hash: scripts/travis/before_install.sh:6","Warn: npmCommand not pinned by hash: scripts/travis/install.sh:7","Info:   0 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.md:0","Info: FSF or OSI recognized license: MIT License: license.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-15T10:41:54.363Z","repository_id":57134201,"created_at":"2025-08-15T10:41:54.363Z","updated_at":"2025-08-15T10:41:54.363Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936431,"owners_count":25018162,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["nodejs","stream","transform-stream","transform-streams"],"created_at":"2024-10-26T11:23:29.344Z","updated_at":"2026-02-10T08:31:53.996Z","avatar_url":"https://github.com/ORESoftware.png","language":"JavaScript","readme":"\n## @oresoftware/json-stream-parser\n\n[![Version](https://img.shields.io/npm/v/@oresoftware/json-stream-parser.svg?colorB=green)](https://www.npmjs.com/package/@oresoftware/json-stream-parser)\n\n\n### Transform stream\n\n\u003e\n\u003e  Transforms JSON stream to JS Objects\n\u003e\n\n### Installation\n\n```bash\n\n$ npm install '@oresoftware/json-stream-parser'\n\n```\n\n### Import\n\n```js\n\nimport {JSONParser} from '@oresoftware/json-stream-parser';\n\n```\n\n### Usage\n\nRight now, the library assumes each separate chunk of json is separated by newline characters. \u003cbr\u003e\nIn the future, we could attempt to use a different delimiting character, as a user-provided input variable. \u003cbr\u003e\nRecommendations welcome.\n\n\n## Examples\n\n#### Simple Node.js example:\n\n###### Reading from stdin\n\n```typescript\n\nprocess.stdin.resume().pipe(new JSONParser()).on('data', d =\u003e {\n  // now we got some POJSOs!\n});\n\n```\n\n###### Reading/writing to a tcp socket\n\n```typescript\n\nimport * as net from 'net';\nconst [port,host] = [6970,'localhost'];\nconst ws = net.createConnection(port, host);\n\nws.setEncoding('utf8')\n  .pipe(new JSONParser())   // tcp connection is bidirection/full-duplex .. we send JSON strings each way\n  .on('data', onData);    // we receive data coming from the tcp server here\n\n\n// and we send data like this:\nws.write(JSON.stringify({'some':'data'}) + '\\n', 'utf8', cb); // make sure to include the newline char when you write\n\n```\n\n#### Using bash shell\n\n###### Simple bash example:\n\n```js\n\nconst k = cp.spawn('bash');\nk.stdin.end(`echo '{\"foo\":\"bar\"}\\n'`);  // make sure to include the newline char when you write\n\nk.stdout.pipe(new JSONParser()).on('data', d =\u003e {\n  // =\u003e {foo: 'bar'}\n});\n\n```\n\n###### Bash example with bash variables:\n\n```js\n\nconst k = cp.spawn('bash');\n\nk.stdin.end(`\n\n  foo=\"medicine\"\n  cat \u003c\u003cEOF\\n{\"foo\":\"$foo\"}\\nEOF  # make sure to include the newline char when you write\n\n`);\n\nk.stdout.pipe(new JSONParser()).on('data', d =\u003e {\n    assert.deepStrictEqual(d, {foo: 'medicine'});  // should pass\n});\n\n\n```\n\n### If your JSON has white space (newlines etc)\n\nIf you JSON has unescaped newlines, or the JSON is separated by some other character, then use the delimiter option.\n\n```js\nnew JSONParser({delimiter: '∆∆∆'});  // use 3 alt-j's to separate json chunks, since newlines won't work\n\n```\n\nFor other solutions to parsing JSON from CLIs, see:\nhttps://stackoverflow.com/questions/56014438/get-single-line-json-from-aws-cli\n\n\n\n### Other options\n\n1. delayEvery: integer  \n\n\u003e every x chunks, will use setImmediate to delay processing, good for not blocking the event loop too much.\n\n\n2. emitNonJSON: boolean\n\n\u003e if there is a line of input that cannot be JSON parsed, it will be emitted as \"string\", but it will not pushed to output\n\n\n3. there are some secret options in the code, have a look in `lib/main.ts`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fjson-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foresoftware%2Fjson-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fjson-parser/lists"}