{"id":44649262,"url":"https://github.com/dakusui/jq-front","last_synced_at":"2026-02-14T20:38:28.497Z","repository":{"id":46601104,"uuid":"204791565","full_name":"dakusui/jq-front","owner":"dakusui","description":"A tool to empower your JSON","archived":false,"fork":false,"pushed_at":"2025-09-11T22:25:11.000Z","size":7660,"stargazers_count":11,"open_issues_count":13,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-12T01:02:18.063Z","etag":null,"topics":["docker-image","json"],"latest_commit_sha":null,"homepage":"https://dakusui.github.io/jq-front/","language":"Shell","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/dakusui.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":"2019-08-27T21:13:29.000Z","updated_at":"2025-09-11T22:25:11.000Z","dependencies_parsed_at":"2024-03-10T04:20:57.720Z","dependency_job_id":"f8dba6c2-a1c6-45be-b0fd-556ada537900","html_url":"https://github.com/dakusui/jq-front","commit_stats":null,"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/dakusui/jq-front","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakusui%2Fjq-front","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakusui%2Fjq-front/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakusui%2Fjq-front/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakusui%2Fjq-front/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dakusui","download_url":"https://codeload.github.com/dakusui/jq-front/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakusui%2Fjq-front/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["docker-image","json"],"created_at":"2026-02-14T20:38:27.901Z","updated_at":"2026-02-14T20:38:28.492Z","avatar_url":"https://github.com/dakusui.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `jq-front`: JSON with inheritance and templating\n\n**NOTE**: [jq++](https://github.com/dakusui/jqplusplus) project, which aims at implementing jq-front in Go, is going on!\n\n`jq-front` is a simple tool to give your JSON files a power of inheritance and templating.\n\nIn testing, system configuration, gaming, music compositions, etc., we see a lot of data items that are similar to each others yet slightly different from each others.\n\nTest cases, deployment descriptors, mob characters, or Tetsuya Komuro's pieces.\nIn general programming languages, many techniques have been developed such as class inheritance, interface, library function, macro, etc., etc.\nHowever, in recent data notations such as JSON, YAML, HCL, etc. this is a concern not seriously taken into account.\nOne approach is HOCON, which is yet another data notation.\nThe approach `jq-front` takes is a bit different.\nInstead of coming up with a new data notation, it introduces several keywords into JSON, which is used as a subset of newer notations and which you can always convert them into as a matter of fact.\nBy taking this approach, you can write your YAML, HCL, HOCON files, using the keywords specified by `jq-front`.\nThus, you can enjoy the benefit of the benefits of them and at the same time the functionalities of `jq-front`.\n\nIt provides inheritance of JSON files, references between JSON nodes, computation of a node value from another, and more.\n\nBut note that it's slow because it's written in `bash`.\nI didn't notice this tool can be useful this much when I started writing it.\nI am planning to re-write it in a full-fledge language like Java (or golang?) to create a faster version of `jq-front`.\n\nMaybe you wonder if it's tested enough.\nDon't worry about that.\nIt's quite well tested and you can check the test suite here: https://github.com/dakusui/jq-front/tree/master/tests\nI hope your product is better tested than this ;)\n\n## Usage\n\n```shell script\njq-front [-h|--help] [--validation=no|strict|lenient] [--nested-templating-levels=num] [--version] [TARGET]\n```\n\n- `-h`, `--help`: Shows a help\n- `--validation`: Validation mode.\n`no`, `strict`, and `lenient` are available.\n- `--nested-templating-levels:` Number of times templating happens in the process. The default is 5. If templating doesn’t finish within ```num``` times, an error will be reported.\n- `--version`: Shows a version.\n- `TARGET`: A file to be processed. If not given, `stdin` will be processed\n \n### Example\n\n\nLet's prepare files, `name.json` and `greeting.json`, from which you want to create a new JSON by extending them.\n\n```shell script\n$ echo '{\"yourname\":\"Mark\"}' \u003e name.json\n$ cat name.json\n{\"yourname\":\"Mark\"}\n\n$ echo '{\"greeting\":\"Hello\"}' \u003e greeting.json\n$ cat greeting.json\n{\"greeting\":\"Hello\"}\n```\n\nThen create a file that extends them.\n\n```shell script\n$ echo '{\n    \"$extends\": [\"greeting.json\", \"name.json\"],\n    \"sayHello\": \"eval:$(ref .greeting), $(ref .yourname). Toady is $(date). How are you doing?\"\n  }' \u003e sayHello.json\n```\n\nNow, let's try `jq-front`.\n```shell script\n$ jq-front sayHello.json\n{\n  \"yourname\": \"Mark\",\n  \"greeting\": \"Hello\",\n  \"sayHello\": \"Hello, Mark. Toady is Fri Aug 30 22:04:40 UTC 2019. How are you doing?\"\n}\n$\n```\nDoesn't it seem useful? Have fun!\n\n## Installation\n\n### Ubuntu\nPlace the file `jq-front`, `lib`, and `schema` somewhere on your `PATH`.\nFollowing tools are used to develop `jq-front`.\nA version for each tool used for development and testing are found in parentheses.\n\n* `bash` (`5.0.17`)\n* `jq` (`1.6`)\n* `npm` (`6.14.4`)\n  * `yamljs` (`0.3.0`)\n\nRefer to the `Dockerfile` for procedure to set up development environment. \n\n### With Docker\n\nAdd a following entry to your `.bashrc` or a file sourced through it.\n\n```shell script\n\nfunction jq-front() {\n  docker run --rm -i \\\n    -v \"${HOME}:/var/lib/jf/${HOME}\" \\\n    -v \"${HOME}/.jq-front.rc:/root/.jq-front.rc\" \\\n    -e JF_PATH_BASE=\"/var/lib/jf\" \\\n    -e JF_PATH=\"${JF_PATH}\" \\\n    -e JF_DEBUG=${JF_DEBUG:-disabled} \\\n    -e JF_CWD=\"$(pwd)\" \\\n    dakusui/jq-front:\"${JF_DOCKER_TAG:-v0.57}\" \"${@}\"\n}\n\n```\n\n**NOTE:** This approach allows you to process files only under `/home/hiroshi` directory.\n\n## Features\n\n* File Level Inheritance\n* Node Level Inheritance\n* Templating (rendering text nodes referring to other nodes' values)\n* Validation (strict and lenient validations)\n\n## Documentation\n\nYou can find more about this product \u003ca href=\"https://dakusui.github.io/jq-front/\"\u003ehere\u003c/a\u003e.\n\n## Contributing\n\n### Step 0: Setting up your box\n\n- Install dependencies mentioned in the Installation section.\n- Install docker\n\n### Step 1: Preparing local repository\n\n- **Option 1**\n    - Fork this repo.\n    - If you have an account in \u003ca href=\"https://hub.docker.com/\"\u003eDocker Hub\u003c/a\u003e, it might be a good idea to update `DOCKER_USER_NAME` in `build_info.sh` with yours to be able to publish your own image. \n\n- **Option 2**\n    - Clone this repo to your local machine using `https://github.com/dakusui/jq-front.git`\n\n### Step 2: Building the tool\n\nThe build procedure of this project can only work on Ubuntu currently.\n\n`bulid.sh` is the tool with which you can generate documentation, perform tests, and package the tool as a docker image.\nEvery time it is invoked it prepares some resources before executing any tasks.\n\nThe tool scans the directory `res` and performs a templating on every file.\nThe scan happens in an alphabetical order of the names of the files.\nAnd each templated file will be copied to a corresponding directory from the current.\nThat is, if you have a file `res/dir1/hello-world.txt`, it will be templated and copied to `dir1/hello-world.txt`.\n\nIn case a file's name starts with a digit(`[0-9]`) and contains an underscore(`_`), the file will be templated and copied to a file whose name doesn't have the portion.\n`res/0hello_hello.txt` will be rendered to `hello.txt`.\nThis behaviour is useful when you want to include a content of another file, whose name comes latter in an alphabetical order than the file you are editing.\n\nNote that dollar signs(`$`) contained by files under `res` directory need to be escaped by a backslash(`\\`). \n\n#### Building the documentation\n\n- Technical documents are stored under `docs` directory in `.adoc` format.\n- Documentation format is `asciidoc`. \n`.html` files are generated automatically. Please don't edit them.\n- Note that `README.md` is generated from `res/README.md` in resource preparation mechanism of the `build.sh`.\nIn case you want to update, edit `res/README.md`.\n\n### Step 3: Hacking away\n\n**HACK AWAY!** 🔨🔨🔨\n\nPlease do not forget adding test cases under `tests` directory.\nProbably `tests/single` directory contains a first example that you can follow.\n\n### Step 4: Testing the product\n\nPlease do\n\n```shell script\n\n$ ./build.sh PACKAGE\n\n```\n\nThis will execute following tasks after resource preparation is finished.\n\n* Build documentation. \n* Run tests.\n* Create a Docker image.\n* Run the same tests using the docker image.\n\n### Step 4: Creating a pull request\n\n- 🔃 Create a new pull request using \u003ca href=\"https://github.com/dakusui/jq-front/compare/\" target=\"_blank\"\u003e`https://github.com/dakusui/jq-front/compare/`\u003c/a\u003e.\nPlease do not forget running tests to ensure that auto-generated resources up-to-date.\nAlso please do not forget removing your custom configuration made on `build_info.sh`.\n\n\n## Authors\n\n* **Hrioshi Ukai** - *Initial work* - \u003ca href=\"https://github.com/dakusui\"\u003edakusui\u003c/a\u003e\n\n## Support\n\n* \u003ca href=\"https://github.com/dakusui/jq-front/issues\"\u003eIssues\u003c/a\u003e\n* Twitter at \u003ca href=\"https://twitter.com/______HU\"\u003e@______HU\u003c/a\u003e\n\n## License\n\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)\n\n- **[MIT license](http://opensource.org/licenses/mit-license.php)**\n- Copyright 2019 © \u003ca href=\"https://github.com/dakusui\" target=\"_blank\"\u003eHiroshi Ukai\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakusui%2Fjq-front","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdakusui%2Fjq-front","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakusui%2Fjq-front/lists"}