{"id":15699829,"url":"https://github.com/liamg/jfather","last_synced_at":"2025-07-17T18:32:55.214Z","repository":{"id":43820133,"uuid":"400572876","full_name":"liamg/jfather","owner":"liamg","description":"JSON parsing with extra metadata","archived":false,"fork":false,"pushed_at":"2022-02-18T17:29:23.000Z","size":189,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T16:52:47.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/liamg.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}},"created_at":"2021-08-27T16:32:49.000Z","updated_at":"2024-02-25T21:33:16.000Z","dependencies_parsed_at":"2022-09-26T16:22:31.360Z","dependency_job_id":null,"html_url":"https://github.com/liamg/jfather","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/liamg/jfather","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fjfather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fjfather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fjfather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fjfather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liamg","download_url":"https://codeload.github.com/liamg/jfather/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fjfather/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265645445,"owners_count":23804188,"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":[],"created_at":"2024-10-03T19:41:51.036Z","updated_at":"2025-07-17T18:32:55.192Z","avatar_url":"https://github.com/liamg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jfather\n\n[![build](https://github.com/liamg/jfather/actions/workflows/test.yml/badge.svg)](https://github.com/liamg/jfather/actions/workflows/test.yml)\n\nParse JSON with line numbers and more!\n\nThis is a JSON parsing module that provides additional information during the unmarshalling process, such as line numbers, columns etc.\n\nYou can use jfather to unmarshal JSON just like the `encoding/json` package, and add your own unmarshalling functionality to gather metadata by implementing the `jfather.Umarshaller` interface. This requires a single method with the signature `UnmarshalJSONWithMetadata(node jfather.Node) error`. A full example is below.\n\nYou should not use this package unless you need the line/column metadata, as unmarshalling is typically much slower than the `encoding/json` package:\n\n```\nBenchmarkUnmarshal_JFather-8       \t   39483\t     34222 ns/op\nBenchmarkUnmarshal_Traditional-8   \t  176756\t      7244 ns/op\n```\n\n## Full Example\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/liamg/jfather\"\n)\n\ntype ExampleParent struct {\n\tChild ExampleChild `json:\"child\"`\n}\n\ntype ExampleChild struct {\n\tName   string\n\tLine   int\n\tColumn int\n}\n\nfunc (t *ExampleChild) UnmarshalJSONWithMetadata(node jfather.Node) error {\n\tt.Line = node.Range().Start.Line\n\tt.Column = node.Range().Start.Column\n\treturn node.Decode(\u0026t.Name)\n}\n\nfunc main() {\n\tinput := []byte(`{\n\t\"child\": \"secret\"\n}`)\n\tvar parent ExampleParent\n\tif err := jfather.Unmarshal(input, \u0026parent); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"Child value is at line %d, column %d, and is set to '%s'\\n\",\n\t\tparent.Child.Line, parent.Child.Column, parent.Child.Name)\n\n\t// outputs:\n\t//  Child value is at line 2, column 12, and is set to 'secret'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fjfather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliamg%2Fjfather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fjfather/lists"}