{"id":33185519,"url":"https://github.com/we-cli/jayin","last_synced_at":"2026-02-19T09:01:16.314Z","repository":{"id":57279732,"uuid":"58847775","full_name":"we-cli/jayin","owner":"we-cli","description":"Piping with js at terminal","archived":false,"fork":false,"pushed_at":"2024-11-07T04:03:42.000Z","size":41,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"dev","last_synced_at":"2025-11-17T10:02:43.742Z","etag":null,"topics":["cli","json","lodash","pipe"],"latest_commit_sha":null,"homepage":"https://github.com/fritx/jayin","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/we-cli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-05-15T06:37:34.000Z","updated_at":"2024-11-07T04:03:45.000Z","dependencies_parsed_at":"2025-11-17T10:01:44.146Z","dependency_job_id":null,"html_url":"https://github.com/we-cli/jayin","commit_stats":null,"previous_names":["fritx/jayin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/we-cli/jayin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we-cli%2Fjayin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we-cli%2Fjayin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we-cli%2Fjayin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we-cli%2Fjayin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/we-cli","download_url":"https://codeload.github.com/we-cli/jayin/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we-cli%2Fjayin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29602275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T04:01:40.476Z","status":"ssl_error","status_checked_at":"2026-02-19T04:01:12.960Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","json","lodash","pipe"],"created_at":"2025-11-16T05:00:20.093Z","updated_at":"2026-02-19T09:01:16.268Z","avatar_url":"https://github.com/we-cli.png","language":"JavaScript","funding_links":[],"categories":["\u003ca name=\"data-management-json\"\u003e\u003c/a\u003eData management - JSON/YAML/etc."],"sub_categories":[],"readme":"# jayin\n\n\u003ca href=\"https://github.com/fritx/jayin\"\u003e\u003cimg width=\"90\" height=\"20\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;[![cov](https://we-cli.github.io/jayin/badges/coverage.svg)](https://github.com/fritx/jayin/actions/workflows/unit-test.yml)\n\u0026nbsp;\u0026nbsp;[![unit](https://github.com/fritx/jayin/actions/workflows/unit-test.yml/badge.svg)](https://github.com/fritx/jayin/actions/workflows/unit-test.yml)\u0026nbsp;\u0026nbsp;[![e2e](https://github.com/fritx/jayin/actions/workflows/e2e-test.yml/badge.svg)](https://github.com/fritx/jayin/actions/workflows/e2e-test.yml)\n\nLet's say you have a gitignore-like file:\n\n```plain\n# https://github.com/fritx/dotfiles\n# .gitignore\n*\n!.gitignore\n!README.md\n!prs-welcome.svg\n!.bashrc\n!.bash_profile\n!.exports\n!.aliases\n!.editorconfig\n```\n\nYou want to cp the listed files to another folder.\n\nDo it in bash?\n\n```shell\nfiles=$(cat .gitignore | sed /^\\*$/d | sed s/\\!//)\nfor file in $files; do cp $file ./dotfiles/; done\n\n# or even\ncat file | sed /^\\*$/d | sed s/\\!// \\\n  | while read -r file; do cp $file ./dotfiles/; done\n\n# thanks to @congeec, http://v2ex.com/t/278831#reply3\nsed /^\\*$/d .gitignore | sed s/\\!// | xargs -I{} cp {} ./dotfiles/\n```\n\n\u003ca href=\"https://github.com/fritx/jayin\"\u003e\u003cimg width=\"213\" height=\"211\" src=\"https://raw.gitmirror.com/we-cli/jayin/dev/wtf.jpg\"\u003e\u003c/a\u003e\n\nWTF?\n\nAs a node.js developer, what if using just js flow/style?\n\n```shell\ncat .gitignore | js -ti 'x.trim().split(`\\n`).slice(1).map(x =\u003e x.slice(1))' \\\n  | js -e 'exec(`cp ${x} ./dotfiles/`)'\n\n# same as\ncat .gitignore | js -ti 'x.trim().split(`\\n`)' \\\n  | js 'x.slice(1)' \\\n  | js 'x.map(x =\u003e x.slice(1))' \\\n  | js -e -c 'cp ${x} ./dotfiles/'\n```\n\n```shell\n# lodash is also integrated in\n# https://github.com/lodash/lodash\necho '[1,2,3,4]' | js '_.filter(x, x =\u003e x % 2)'  \\\n  | js '_.reverse(x)'  \\\n  \u003e file\n\n# or in chain\necho '[1,2,3,4]'  \\\n  | js '_(x).filter(x =\u003e x % 2).reverse().value()'  \\\n  \u003e file\n```\n\nDon't forget to take an alias if you want.\n\n```shell\nnpm install -g jayin\nalias js=\"jayin\"\n```\n\n- `-ti`: input as text, no more JSON.parse\n- `-to`: output as text, no more JSON.stringify\n- `-t`: input/output both as text\n- `-e`: for each, in chain\n- `-c`: shortcut of exec(cmd)\n- `x`: current input value\n- `i`: current index value (with -e)\n- `_`: lodash\n- `exec(cmd)`: child_process.execSync(cmd)\n\njayin is based on [through2](https://github.com/rvagg/through2).\n\nIf you've seen anything that is similar to this, don't hesitate to let me know ;)\n\n## Compatibility\n\n| os  | Windows | Ubuntu | MacOS |\n|:---:|:---:|:---:|:---:|\n| supported | ✅ | ✅ | ✅ |\n\n| node    | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |\n|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n| supported    | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |\n\nSee also: [.github/workflows/](https://github.com/fritx/jayin/blob/dev/.github/workflows/)\n\n## License\n\n[MIT](https://github.com/fritx/jayin/blob/dev/LICENSE) License\n\nCopyright (c) 2016-Present [Fritz Lin](https://github.com/fritx)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwe-cli%2Fjayin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwe-cli%2Fjayin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwe-cli%2Fjayin/lists"}