{"id":26059983,"url":"https://github.com/tbxark/jsoncompressor","last_synced_at":"2025-07-27T05:35:17.897Z","repository":{"id":278528738,"uuid":"935914817","full_name":"TBXark/jsoncompressor","owner":"TBXark","description":"A tool marshal and unmarshal JSON array as though it were a struct in Go","archived":false,"fork":false,"pushed_at":"2025-04-28T06:49:30.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T07:52:39.461Z","etag":null,"topics":["compressor","go","golang","json"],"latest_commit_sha":null,"homepage":"","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/TBXark.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}},"created_at":"2025-02-20T08:20:56.000Z","updated_at":"2025-02-20T14:45:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7195bad-5b34-41ee-b261-9aa3579dfd94","html_url":"https://github.com/TBXark/jsoncompressor","commit_stats":null,"previous_names":["tbxark/jsoncompressor"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TBXark/jsoncompressor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fjsoncompressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fjsoncompressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fjsoncompressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fjsoncompressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TBXark","download_url":"https://codeload.github.com/TBXark/jsoncompressor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fjsoncompressor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267306863,"owners_count":24067038,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compressor","go","golang","json"],"created_at":"2025-03-08T13:48:51.533Z","updated_at":"2025-07-27T05:35:17.891Z","avatar_url":"https://github.com/TBXark.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonCompressor\n\nJsonCompressor is a lightweight Go library that compresses JSON structures into arrays by preserving only the values while maintaining the field order. It's particularly useful when you need to reduce JSON payload size while retaining the ability to reconstruct the original structure.\n\n## Features\n\n- Compress any struct with JSON tags into an array format\n- Decompress arrays back into their original struct format\n- Recursive handling of nested structures and arrays\n- Preserves field order based on struct definition\n- Type-safe conversion\n\n## Installation\n\n```bash\ngo get github.com/TBXark/jsoncompressor\n```\n\n## Usage\n\n```go\ntype Person struct {\n    Name    string   `json:\"name\"`\n    Age     int      `json:\"age\"`\n    Hobbies []string `json:\"hobbies\"`\n    Address struct {\n        City    string `json:\"city\"`\n        Country string `json:\"country\"`\n    } `json:\"address\"`\n}\n\n// Create a sample struct\nperson := Person{\n    Name:    \"John Doe\",\n    Age:     30,\n    Hobbies: []string{\"reading\", \"coding\"},\n    Address: struct {\n        City    string `json:\"city\"`\n        Country string `json:\"country\"`\n    }{\n        City:    \"New York\",\n        Country: \"USA\",\n    },\n}\n\n// Compress\ncompressed, err := jsoncompressor.Marshal(person)\nif err != nil {\n    log.Fatal(err)\n}\n// Result: [\"John Doe\", 30, [\"reading\", \"coding\"], [\"New York\", \"USA\"]]\n\n// Decompress\nvar decompressed Person\nerr = jsoncompressor.Unmarshal(compressed, \u0026decompressed)\nif err != nil {\n    log.Fatal(err)\n}\n```\n\n## Notes\n\n- Only processes fields with JSON tags\n- Field order must be consistent between compression and decompression\n- Requires proper type matching for successful decompression\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fjsoncompressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbxark%2Fjsoncompressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fjsoncompressor/lists"}