{"id":16712778,"url":"https://github.com/aead/mem","last_synced_at":"2025-07-27T17:04:58.109Z","repository":{"id":62866932,"uuid":"543531578","full_name":"aead/mem","owner":"aead","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-15T14:34:26.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T07:11:20.731Z","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/aead.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":"2022-09-30T09:46:49.000Z","updated_at":"2022-11-29T22:54:01.000Z","dependencies_parsed_at":"2022-11-08T06:33:23.240Z","dependency_job_id":null,"html_url":"https://github.com/aead/mem","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aead%2Fmem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aead%2Fmem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aead%2Fmem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aead%2Fmem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aead","download_url":"https://codeload.github.com/aead/mem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166927,"owners_count":21058480,"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-12T20:44:03.340Z","updated_at":"2025-04-10T05:54:22.816Z","avatar_url":"https://github.com/aead.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/aead.dev/mem.svg)](https://pkg.go.dev/aead.dev/mem)\n![Github CI](https://github.com/aead/mem/actions/workflows/build.yml/badge.svg?branch=main)\n\nThe `mem` package provides types and functions for measuring and displaying memory throughput and capacity.\n\n### Example\n\nWalk the directory tree of the current directory and list all (non-hidden) files and the corresponding file sizes.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"io/fs\"\n    \"path/filepath\"\n    \"strings\"\n\n    \"aead.dev/mem\"\n)\n\nfunc main() {\n    const Directory = \".\"\n    filepath.WalkDir(Directory, func(path string, entry fs.DirEntry, err error) error {\n        if entry.IsDir() {\n            if entry.Name() != Directory \u0026\u0026 strings.HasPrefix(entry.Name(), \".\") { // Skip hidden sub directories\n                return filepath.SkipDir\n            }\n            fmt.Println(entry.Name())\n            return nil\n        }\n\n        stat, err := entry.Info()\n        if err == nil {\n            var size mem.Size = mem.Size(stat.Size())\n            fmt.Printf(\"  %-20s %10s\\n\", stat.Name(), mem.FormatSize(size, 'D', 2))\n        }\n        return nil\n    })\n}\n```\n\u003cdetails\u003e\u003csummary\u003eExample Ouput\u003c/summary\u003e\n\n```\n.\n  .gitignore              269.00B\n  .golangci.yml           420.00B\n  LICENSE                  1.08KB\n  benchmark_test.go        1.47KB\n  bitsize.go               2.79KB\n  bitsize_test.go          3.38KB\ncmd\nexample\n  main.go                 605.00B\n  doc.go                   2.91KB\n  examples_test.go         1.76KB\n  format.go               10.15KB\n  format_test.go           4.24KB\n  go.mod                   29.00B\n  math.go                 831.00B\n  math_test.go             2.28KB\n  progress.go             842.00B\n  size.go                  3.00KB\n  size_test.go             3.73KB\n```\n\n\u003c/details\u003e\n\n## Install\n\nAdd `aead.dev/mem` as dependency to your `go.mod` file:\n\n```\ngo mod download aead.dev/mem@latest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faead%2Fmem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faead%2Fmem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faead%2Fmem/lists"}