{"id":17560030,"url":"https://github.com/piglig/go-unitypackage","last_synced_at":"2025-04-28T10:47:16.039Z","repository":{"id":37427260,"uuid":"429285953","full_name":"piglig/go-unitypackage","owner":"piglig","description":"pack and unpack .unitypackage files, with Golang","archived":false,"fork":false,"pushed_at":"2024-05-09T06:11:17.000Z","size":57,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-18T15:16:35.663Z","etag":null,"topics":["golang","unity","unitypackage"],"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/piglig.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":"2021-11-18T03:40:39.000Z","updated_at":"2025-04-05T01:57:20.000Z","dependencies_parsed_at":"2024-05-09T06:50:35.642Z","dependency_job_id":null,"html_url":"https://github.com/piglig/go-unitypackage","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-unitypackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-unitypackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-unitypackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-unitypackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piglig","download_url":"https://codeload.github.com/piglig/go-unitypackage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251298198,"owners_count":21566971,"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":["golang","unity","unitypackage"],"created_at":"2024-10-21T11:09:24.882Z","updated_at":"2025-04-28T10:47:16.013Z","avatar_url":"https://github.com/piglig.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-unitypackage\n[![GoDoc](https://godoc.org/github.com/piglig/go-unitypackage?status.svg)](https://pkg.go.dev/github.com/piglig/go-unitypackage)\n[![Go Report Card](https://goreportcard.com/badge/github.com/piglig/go-unitypackage)](https://goreportcard.com/report/github.com/piglig/go-unitypackage)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n## Overview\npack and unpack *.unitypackage files, with Golang\n\n## Installation\n```go\ngo get github.com/piglig/go-unitypackage\n```\n\n## How to use\n### UnPackage\n```go\npackage main\n\nimport \"github.com/piglig/go-unitypackage\"\n\nfunc main() {\n\t// the unitypackage path\n\tpackagePath := \"D:\\\\test_unity\\\\test.unitypackage\"\n\t// the output assets path\n\tassetsPath := \"D:\\\\test_unity\"\n\t// Unpackage command will extract content from unitypackage.\n\terr := unitypackage.UnPackage(packagePath, assetsPath)\n\tif err != nil {\n\t\treturn\n\t}\n}\n```\n### Package\n```Golang\npackage main\n\nimport \"github.com/piglig/go-unitypackage\"\n\nfunc main() {\n\t// the assets directory\n\tassetsPath := \"D:\\\\test_unity\"\n\t// the output unitypackage path\n\tpackagePath := \"D:\\\\test_unity\\\\package\\\\output.unitypackage\"\n\t// GeneratePackage command will generate a package from assets directory\n\terr := unitypackage.GeneratePackage(assetsPath, packagePath)\n\tif err != nil {\n\t\treturn\n\t}\n}\n```\n\n## Command Line Tool\n**go-unitypackage** command line tool to package or unpackage the unitypackage.\n### Installation\nIn order to use the tool, compile it using the following command\n```shell\ngo install github.com/piglig/go-unitypackage/tools/go-unitypackage@latest\n```\n\n### Usage\n```shell\ngo-unitypackage [options] [arguments]\n```\n\n#### Options\n- `-act`: compress or decompress unitypackage (default \"decompress\")\n#### Arguments\n- `-src`: compress or decompress the source directory\n- `-dest`: compress or decompress the destination directory\n### Example\n```shell\n$:/usr/local/test_unity# ls\ntest.unitypackage\n\n$:/usr/local/test_unity# go-unitypackage -src=test.unitypackage -dest=.\n2023/04/04 10:59:55 target: /tmp/md5136041829/afd150e418c353f49b2bd5b68d0c43fa header:  afd150e418c353f49b2bd5b68d0c43fa\n2023/04/04 10:59:55 target: /tmp/md5136041829/afd150e418c353f49b2bd5b68d0c43fa/asset header:  afd150e418c353f49b2bd5b68d0c43fa/asset\n2023/04/04 10:59:55 target: /tmp/md5136041829/afd150e418c353f49b2bd5b68d0c43fa/asset.meta header:  afd150e418c353f49b2bd5b68d0c43fa/asset.meta\n2023/04/04 10:59:55 target: /tmp/md5136041829/afd150e418c353f49b2bd5b68d0c43fa/pathname header:  afd150e418c353f49b2bd5b68d0c43fa/pathname\n\n$:/usr/local/test_unity# ls\nAssets  Assets.meta test.unitypackage\n\n$:/usr/local/test_unity# mkdir package\n\n$:/usr/local/test_unity# go-unitypackage -act=compress -src=. -dest=package/out.unitypackage\n\n$:/usr/local/test_unity/package# ls -l\ntotal 4\n-rw-r--r-- 1 root root 340 Apr  4 11:03 out.unitypackage\n```\n## License\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiglig%2Fgo-unitypackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiglig%2Fgo-unitypackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiglig%2Fgo-unitypackage/lists"}