{"id":16371285,"url":"https://github.com/deptno/hosejs","last_synced_at":"2025-03-23T02:34:19.337Z","repository":{"id":57266699,"uuid":"134139556","full_name":"deptno/hosejs","owner":"deptno","description":":male_detective: Alternative jq, for javascripter","archived":false,"fork":false,"pushed_at":"2018-05-28T17:08:29.000Z","size":480,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T22:04:23.630Z","etag":null,"topics":["better-jq","javascript-cli","javascript-tools","jq","jq-alternative","json","json-pipeline","json-transformation"],"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/deptno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-05-20T10:07:54.000Z","updated_at":"2025-01-10T18:24:00.000Z","dependencies_parsed_at":"2022-08-25T02:51:43.728Z","dependency_job_id":null,"html_url":"https://github.com/deptno/hosejs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Fhosejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Fhosejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Fhosejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Fhosejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deptno","download_url":"https://codeload.github.com/deptno/hosejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244267383,"owners_count":20425836,"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":["better-jq","javascript-cli","javascript-tools","jq","jq-alternative","json","json-pipeline","json-transformation"],"created_at":"2024-10-11T03:07:32.582Z","updated_at":"2025-03-23T02:34:19.038Z","avatar_url":"https://github.com/deptno.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HoseJS [![CircleCI](https://circleci.com/gh/deptno/hosejs.svg?style=svg)](https://circleci.com/gh/deptno/hosejs)\n\n[![npm](https://img.shields.io/npm/dt/hosejs.svg?style=for-the-badge)](https://www.npmjs.com/package/hosejs)\n\n\u003e :tada: Data handling with ramda.js (version 1.3 or higher)\n\n![hosejs](https://github.com/deptno/hosejs/raw/master/asset/hosejs.gif)\n\n\u003e 100% code coverage.\n\nYou can transform JSON(or NOT) data with just **JavaScript** in terminal.\n\n`jq`? javascript is clearly better option for people already use javascript.\n\n## Feature\n\n### Data handling with ramda.js (version 1.3 or higher)\n\nYou can use [ramda.js](https://ramdajs.com\u003e)\n\neg. `http https://swapi.co/api/people/1/ | j -r \"props(['name', 'height'])\"`  \neg. `http https://swapi.co/api/people/1/ | j -ramda \"props(['name', 'height'])\"`  \neg. `http https://swapi.co/api/people/1/ | j \"props(['name', 'height'])(_)\"`\n\n## Options\n\n- `--file` option provide you to apply pre-defined script first\n- `--tab` if result is Object, print JSON format with specified tab size (default: 2)\n\n## Install\n\n```\nnpm -g install hosejs\n```\n\n## Command\n\n`j` or `js`\n\n\n## Usage\n\n`_` is everything you need to know\n\n```bash\n$ cat some.json | j '_.map(x =\u003e x.timestamp)'\n$ cat some.json | j '_.map(x =\u003e x.timestamp)' --tab 4\n$ cat some.json | j '_.map(x =\u003e x.timestamp)' --file pre.js --tab 2\n$ cat some.json | j '_.map(x =\u003e x.timestamp)' \u003e some.json\n$ cat some.json | j '[_].map(x =\u003e x.some_property + '👍')[0]'\n$ cat some.json | j '_.map(x =\u003e new Date(x.timestamp).toISOString())'\n$ cat some.json | j --file preload.js '_.map(x =\u003e x.timestamp)'\n$ http https://swapi.co/api/people/ | j 'Object.keys(_)'\n$ http https://swapi.co/api/people/ | j '_.count'\n$ http https://swapi.co/api/people/ | j '_.results.map(x =\u003e x.name)'\n$ echo 'not json string \\n !!' | j '_.split(\"\\n\")'\n$ http https://swapi.co/api/people/1/ | j -r \"props(['name', 'height'])\"  \n$ http https://swapi.co/api/people/1/ | j -ramda \"props(['name', 'height'])\"  \n$ http https://swapi.co/api/people/1/ | j \"props(['name', 'height'])(_)\"\n\n```\n\n### Inject script file\n\n#### IIFE\n\n```js\n// cw-oneline.js\n(() =\u003e {\n  const time = time =\u003e new Date(time).toISOString().slice(0, -5).replace('T', ' ')\n  return _.map(x =\u003e `${time(x.timestamp)} ${x.message}`)\n})()\n```\n\n```bash\ncat downloaded-cw-log.json | j -f cw-oneline.js \u003e deptno.latest.json\n```\n\n\u003e Hmm ... Is it easy to look upside down?\n\nadd `_.reverse()`\n\n```bash\ncat downloaded-cw-log.json | j -f cw-oneline.js '_.reverse()' \u003e deptno.latest.json\n```\n\n## Related\n\n- [cwlog](https://github.com/deptno/cwlog) 🐾 cli AWS Cloudwatch Logs Downloader\n- [post](https://medium.com/@deptno/hosejs-jq-그냥-javascript-합시다-64bda90967d8)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeptno%2Fhosejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeptno%2Fhosejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeptno%2Fhosejs/lists"}