{"id":46905604,"url":"https://github.com/connected-web/mkvconf","last_synced_at":"2026-03-11T01:10:06.089Z","repository":{"id":46005196,"uuid":"430211472","full_name":"connected-web/mkvconf","owner":"connected-web","description":"Custom configuration file format that parses to JSON","archived":false,"fork":false,"pushed_at":"2022-01-21T14:37:32.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T22:12:55.006Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/connected-web.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-20T21:19:40.000Z","updated_at":"2021-11-25T10:13:09.000Z","dependencies_parsed_at":"2022-08-26T18:12:40.472Z","dependency_job_id":null,"html_url":"https://github.com/connected-web/mkvconf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/connected-web/mkvconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fmkvconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fmkvconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fmkvconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fmkvconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connected-web","download_url":"https://codeload.github.com/connected-web/mkvconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fmkvconf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30365047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-03-11T01:10:05.634Z","updated_at":"2026-03-11T01:10:06.063Z","avatar_url":"https://github.com/connected-web.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkvconf\n\nA custom configuration file format that maps to JSON; a more forgiving and less boiler plate way of writing data for systems.\n\nThis implementation of `mkvconf` is written in javascript, and uses `nodejs` and `npm`.\n\nThe format allows for groups of objects to be quickly copy and pasted, with a forgiving minimalist format for building lists of objects with complex properties quickly.\n\n```\n// mkvconf.file\n\n[Star]\nname                      Sol\nequatorial.radius.min     695,700 km\nequatorial.radius.max     696,342 km\nequatorial.circumference  4.379×106 km\nflattening                9×10−6\nsurface.area              6.09×1012 km²\nvolume                    1.41×1018 km³\nmass                      1.9885×1030 kg\ncomposition.Hydrogen      73.46%\ncomposition.Helium        24.85%\ncomposition.Oxygen        0.77%\ncomposition.Carbon        0.29%\ncomposition.Iron          0.16%\ncomposition.Neon          0.12%\ncomposition.Nitrogen      0.09%\ncomposition.Silicon       0.07%\ncomposition.Magnesium     0.05%\ncomposition.Sulphur       0.04%\n\n[Planet]\nname             Earth\ndistance.to.sun  149.6 million km\nplanet.radius    6,371 km\nsurface.area     510.1 million km²\nland.area        148.9 million km²\nmass             5.972 × 10^24 kg\n\n[Planet]\nname             Mercury\ndistance.to.sun  57.91 million km\norbital.period   88 days\nplanet.radius    2,439.7 km\nsurface.area     74.8 million km²\nlength.of.day    58d 15h 30m\nmass             3.285 × 10^23 kg\ndensity          5.43 g/cm³\n```\n\n## Command line tool\n\nIf this file format is interesting to you; you may want to read about the [mkvconf command line tool](./CLI.md).\n\n## Development Usage\n\nInstall the local package:\n\n```\nnpm install mkvconf\n```\n\n### Deserialising data (parse)\n\nTo load and parse data:\n\n```js\nconst mkvconf = require('mkvconf')\nconst fs = require('fs')\n\nconst body = fs.readFileSync('item.file', 'utf8')\nconst data = mkconf.parse(body)\nconsole.log(data)\n```\n\n### Serializing data (format)\n\nTo produce a `mkvconf` file from data:\n\n```js\nconst mkvconf = require('mkvconf')\nconst data = {\n  Fruits: [{\n    name: 'Apple',\n    cost: '£0.34/kg'\n  }, {\n    name: 'Orange'\n    cost: '£0.42/kg'\n  }, {\n    name: 'Banana',\n    cost: '$0.65/kg'\n  }]\n}\nconst text = mkvconf.format(data)\nconsole.log(text)\n```\n\n## Item example\n\n```file\n// item.file\n[Item]\nid             item-1\nmeta.name      Item One\nposition.x     124\nposition.y     523    \n\n[Item]\nid             item-2\nmeta.name      Item Two\nposition.x     224\nposition.y     323  \n```\n\nParses to:\n\n```json\n{\n  \"Item\": [{\n    \"id\": \"item-1\",\n    \"meta\": {\n      \"name\": \"Item One\"\n    },\n    \"position\": {\n      \"x\": 124,\n      \"y\": 523\n    }\n  }, {\n    \"id\": \"item-2\",\n    \"meta\": {\n      \"name\": \"Item Two\"\n    },\n    \"position\": {\n      \"x\": 224,\n      \"y\": 323\n    }\n  }],\n  \"comments\": [\n    \"// item.file\"\n  ]\n}\n```\n\n## Fruit example\n\n```\n// fruit.file\n[Fruit]\nname Banana\nskin yellow\nflesh beige\nicon assets/banana.png\n\n[Fruit]\nname Apple\nskin green\nflesh white\nicon assets/apple.png\n```\n\nParses to:\n\n```json\n{\n  \"Fruit\": [{\n    \"name\": \"Banana\",\n    \"skin\": \"yellow\",\n    \"flesh\": \"beige\",\n    \"icon\": \"assets/banana.png\"\n  }, {\n    \"name\": \"Apple\",\n    \"skin\": \"green\",\n    \"flesh\": \"white\",\n    \"icon\": \"assets/apple.png\"\n  }],\n  \"comments\": [\n    \"// fruit.file\"\n  ]\n}\n```\n\n## Parsing rules\n\nThe parsing rules are designed to be very simple.\n\n### Line breaks\n\nLines are parsed using the `\\n` line break. \n\n### Tabs and other spacing\n\nAll lines are trimmed before matching; so extra spaces at the start or ends are ignored.\n\n### Comments\n\nAny line beginning with `//` is considered a comment, and is collected into an array property `comments` in the result.\n\n### Object Group\n\nAny line beginning with `[` and ending with `]` starts a new object group, with the group name based on the internals. Valid characters for the group name are Alpha-numeric with spaces and dashes matching the regex: `/[([A-z\\d- ]+)]/`; the object group name will be trimmed of any additional spacing.\n\n### Key Value Pairs\n\nOnce the first object group has been created; any line that matches the regex `/^([A-z][A-z\\d.]*)\\s+(.*)/` will be considered a key value pair, and added to the last object group. Values are trimmed and parsed. Multi-line values are not supported. Additional spaces between the `key` and the `value` will be ignored.\n\nTo ensure numbers are parsed as numbers, and booleans as booleans, values are passed through `JSON.parse()` - so you could get fancy and embed arrays, or more complex objects, provided they fit on one line.\n\n### Blank lines\n\nEmpty lines are ignored; i.e. anything line that when trimmed has a length of `0`.\n\n### Unmatched lines\n\nLines that do not match a supported regex will be stored in order with the comments. Maybe you can abuse this to store extra data, but your mileage may vary.\n\n## Release notes\n\n### v1.2.0\n\n- Add `fast-glob` support as a dependency to fully resolve glob patterns\n\n### v1.1.1\n\n- Document support for glob matchers e.g. `mkvconf lint **/*.file --fix`\n- Add tests around multiple file support to CLI\n- Sort list of files to ensure consistency of execution\n\n### v1.1.0\n\n- Added json command to CLI tool\n\n### v1.0.1\n\n- Initial release\n- Documentation for file format\n- Added javacsript `.parse` API to read file format to into `js` object/lists\n- Added javascript `.format` API to format JSON as `mkvconf`\n- Added command line support using `npx mkvconf` and `npm install --global mkvconf`\n- Added lint commmand to CLI tool\n- Added lint --fix flag to CLI tool\n- Added lint --suffix flag to CLI tool\n\n## Wishlist\n\n- Consider specifying output path for converted files\n- Consider JSON output to `stdout` for single file conversions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fmkvconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnected-web%2Fmkvconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fmkvconf/lists"}