{"id":18437104,"url":"https://github.com/mfussenegger/mkjson","last_synced_at":"2025-07-04T16:36:44.973Z","repository":{"id":43678567,"uuid":"159562397","full_name":"mfussenegger/mkjson","owner":"mfussenegger","description":"A commandline tool to generate static or random JSON records","archived":false,"fork":false,"pushed_at":"2025-04-05T10:57:12.000Z","size":95,"stargazers_count":39,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T11:22:48.708Z","etag":null,"topics":["cli","fake","faker","faker-generator","json","util"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/mfussenegger.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["mfussenegger"]}},"created_at":"2018-11-28T20:44:32.000Z","updated_at":"2025-04-05T10:57:15.000Z","dependencies_parsed_at":"2025-04-05T11:21:00.655Z","dependency_job_id":"0772db00-be89-4b3d-83cc-e7ac5c0555f8","html_url":"https://github.com/mfussenegger/mkjson","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mfussenegger/mkjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfussenegger%2Fmkjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfussenegger%2Fmkjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfussenegger%2Fmkjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfussenegger%2Fmkjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfussenegger","download_url":"https://codeload.github.com/mfussenegger/mkjson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfussenegger%2Fmkjson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263577272,"owners_count":23483135,"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":["cli","fake","faker","faker-generator","json","util"],"created_at":"2024-11-06T06:13:40.726Z","updated_at":"2025-07-04T16:36:44.949Z","avatar_url":"https://github.com/mfussenegger.png","language":"Haskell","funding_links":["https://github.com/sponsors/mfussenegger"],"categories":[],"sub_categories":[],"readme":"# mkjson\n\n[![CI](https://github.com/mfussenegger/mkjson/workflows/CI/badge.svg)](https://github.com/mfussenegger/mkjson/actions)\n\n`mkjson` is a CLI to generate JSON records.\n\n\nStatic JSON:\n\n```\n↪  mkjson x=10 y=20 foo=bar\n{\"foo\":\"bar\",\"x\":10,\"y\":20}\n```\n\nGenerated random data:\n\n```\n↪  mkjson --num 3 id=\"uuid4()\" x=\"randomInt(0, 10)\"\n{\"id\":\"2c6ce42f-5f7d-4e65-a1a1-8b39f6cfce19\",\"x\":6}\n{\"id\":\"d4c1af69-3cdd-417d-98e0-d3774f5fa1be\",\"x\":8}\n{\"id\":\"8fc064c9-57ba-4d78-b205-57899776e757\",\"x\":6}\n```\n\nIt takes `fieldName=value` or `fieldName=provider()` pairs as\nargument. Each pair will result in a field within the JSON object.\n\nTo generate infinite records, use:\n\n```\n↪  mkjson --num Inf\n```\n\n\n### Examples\n\nUsing `fromFile` and `oneOf`:\n\n```\n↪  mkjson --num 3 w=\"oneOf(fromFile('/usr/share/dict/words'))\"\n{\"w\":\"Karl\"}\n{\"w\":\"demographic\"}\n{\"w\":\"calumny's\"}\n```\n\n\nUse dotted notation to create objects:\n\n```\n↪  mkjson point.x=10 point.y=20\n{\"point\":{\"x\":10,\"y\":20}}\n```\n\nOr nest calls to create objects:\n\n```\n↪  mkjson obj=$(mkjson xs=\"array(randomInt(0, 4), randomInt(5, 9))\")\n{\"obj\":{\"xs\":[2,5]}}\n```\n\nOr use the `object` provider with various providers. Argument are `key, value [, ...]` pairs:\n\n```\n↪  mkjson obj=\"object(dt, randomDateTime(), type, fromRegex('[a-z]{4}-\\d+'), xs, replicate(5, randomInt(0, 10)))\"\n{\"obj\":{\"dt\":\"2099-09-11T16:33:41Z\",\"xs\":[6,8,5,2,0],\"type\":\"ldwa-2667786160\"}}\n```\n\nYou may also want to read this [introduction and sample use case][1].\n\n\n### Available providers\n\n - uuid1\n - uuid4\n - null\n - randomBool\n - randomChar\n - randomInt(lower, upper)\n - randomDouble(lower, upper)\n - randomDate [(lower, upper)]\n - randomDateTime [(lower, upper)]\n - array(expr [, ...])\n - oneOf(arrayExpr)\n - oneOf(expr, expr [, ...])\n - replicate(number, expr)\n - object(key, value [, ...])\n - fromFile(fileName)\n - fromRegex(pattern)\n - join(sep, val1, [, ...])\n - join(array)\n\n\n## Installation\n\nGet a pre-build binary from the\n[releases](https://github.com/mfussenegger/mkjson/releases) page or build it\nyourself:\n\nInstall stack:\n\n```bash\ncurl -sSL https://get.haskellstack.org/ | sh\n```\n\nInstall mkjson:\n\n```bash\ngit clone https://github.com/mfussenegger/mkjson.git\ncd mkjson\nstack install\n```\n\n\n## Alternatives\n\nThere are some alternatives if you're not so interested in the random-value\ngeneration aspect of `mkjson`:\n\n - [jarg](https://github.com/jdp/jarg)\n - [jo](https://github.com/jpmens/jo)\n\n\n[1]: https://zignar.net/2020/05/01/generating-data-sets-using-mkjson/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfussenegger%2Fmkjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfussenegger%2Fmkjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfussenegger%2Fmkjson/lists"}