{"id":13661050,"url":"https://github.com/tsouza/yajs","last_synced_at":"2025-10-14T08:20:11.967Z","repository":{"id":56527079,"uuid":"115128369","full_name":"tsouza/yajs","owner":"tsouza","description":"Yet Another JSON Streaming Tool","archived":false,"fork":false,"pushed_at":"2022-05-02T16:59:58.000Z","size":120,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T23:35:56.182Z","etag":null,"topics":["javascript","json","streaming"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tsouza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-22T15:40:03.000Z","updated_at":"2022-06-22T07:38:53.000Z","dependencies_parsed_at":"2022-08-15T20:20:46.908Z","dependency_job_id":null,"html_url":"https://github.com/tsouza/yajs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsouza/yajs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsouza%2Fyajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsouza%2Fyajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsouza%2Fyajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsouza%2Fyajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsouza","download_url":"https://codeload.github.com/tsouza/yajs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsouza%2Fyajs/sbom","scorecard":{"id":900979,"data":{"date":"2025-08-11","repo":{"name":"github.com/tsouza/yajs","commit":"11df97d748456e1fdeb9489882c61b47d52d5601"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"Code-Review","score":0,"reason":"Found 1/27 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T15:33:09.678Z","repository_id":56527079,"created_at":"2025-08-24T15:33:09.678Z","updated_at":"2025-08-24T15:33:09.678Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018268,"owners_count":26086334,"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-10-14T02:00:06.444Z","response_time":60,"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":["javascript","json","streaming"],"created_at":"2024-08-02T05:01:29.098Z","updated_at":"2025-10-14T08:20:11.961Z","avatar_url":"https://github.com/tsouza.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# YAJS: **Y**et **A**nother **J**SON **S**treaming Tool\n\n[![Build Status via Travis CI](https://travis-ci.org/tsouza/yajs.svg?branch=master)](https://travis-ci.org/tsouza/yajs)\n[![NPM version](https://img.shields.io/npm/v/yajson-stream.svg)](https://www.npmjs.com/package/yajson-stream)\n[![Dependency Status via David DM](https://david-dm.org/tsouza/yajs/status.svg)](https://david-dm.org/tsouza/yajs)\n\nYAJS is a tool for filtering a portion of json files.\n\n## Motivation\n\nThe reason I built this tool is that I could not find a proper json stream processor with the features I needed without sacrificing speed and memory.\n\nThere is a also a benchmark of this tool comparing with [oboe.js](https://github.com/jimhigson/oboe.js) and [JSONStream](https://github.com/dominictarr/JSONStream). See [benchmark](benchmark.md).\n\n## Documentation\n\nHead over to [Wiki](https://github.com/tsouza/yajs/wiki/Getting-Started) for more information on how to use it.\n\n## Example\n\nPipe a text stream of json into YAJS and select 'author' property:\n\n```js\nconst yajs = require('yajson-stream');\nconst { createReadStream } = require('fs');\n\ncreateReadStream('./package.json').\n    pipe(yajs('$.author')).\n    on('data', data =\u003e {\n        console.log(data.path); // outputs [ 'author' ]\n        console.log(data.value); // outputs 'Thiago Souza \u003ctcostasouza@gmail.com\u003e'\n    });\n```\n\n## Command line tool\n\nCall it from a shell:\n\n```bash\n$ npm install -g yajson-stream\n$ cat package.json | yajs '$.author'\n\"Thiago Souza \u003ctcostasouza@gmail.com\u003e\"\n```\n\n## YAJS Selector Syntax\n\nYAJS selector syntax is jsonpath-like, yet it's **not** jsonpath.\n\nYAJS Selector                     | Description\n---------------------------------:|------------\n`$`                               | The root object/element\n`*`                               | Wildcard matching all objects/elements regardless\n`.`                               | Child member operator\n`..`                              | Recursive descendant operator\n`..[\u003cpath filter\u003e]\u003ckey\u003e`          | Recursive descendant operator if path filter evaluates to true (see example below)\n`\u003ckey\u003e{keys filter}`              | Will emit only if keys filter evaluates to true. Only supported in the end of the expression (see example below)\n\n### Example of `..[\u003cfilter keys\u003e]\u003ckey\u003e`\n\nGiven the following json:\n\n```js\n{\n    \"array\": [\n        {\n            \"key1\": {\n                \"child\": \"value1\"\n            }\n        },\n        {\n            \"key2\": {\n                \"child\": \"value2\"\n            }\n        }\n    ]\n}\n```\n\nSelect only the second `child` entry with:\n\n```bash\n$ cat test.json | yajs '$..[!key1]child'\n\"value2\"\n```\n\n### Example of `\u003ckey\u003e{\u003ckeys filter\u003e}`\n\nGiven the following json:\n\n```js\n[\n    {\n        \"object1\": {\n            \"key1\": \"value1\"\n        }\n    },\n    {\n        \"object1\": {\n            \"key2\": \"value1\"\n        }\n    }\n]\n```\n\nWill emit only the first `object1`:\n\n```bash\n$ cat test.json | yajs '$.object1{key1}'\n{\"key1\":\"value1\"}\n```\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the [Github Issues](https://github.com/tsouza/yajs/issues).\n\n## Acknowledgements\n\n* Thanks to [wanglingsong](https://github.com/wanglingsong) for his awesome work with [JsonSurfer](https://github.com/jsurfer/JsonSurfer) which inspired me to create YAJS.\n* Thanks to [creationix](https://github.com/creationix) for his crazy fast [sax-based json parser](https://gist.github.com/creationix/1821394).\n\n## LICENSE\n\nCode and documentation released under [The MIT License (MIT)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsouza%2Fyajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsouza%2Fyajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsouza%2Fyajs/lists"}