{"id":23419683,"url":"https://github.com/brettchalupa/deno_disk_usage","last_synced_at":"2026-04-30T15:31:22.827Z","repository":{"id":269242108,"uuid":"906831937","full_name":"brettchalupa/deno_disk_usage","owner":"brettchalupa","description":"Function for Deno to get usage of a given disk; requires the `df` bin to be installed.","archived":false,"fork":false,"pushed_at":"2024-12-22T03:54:05.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T09:16:57.505Z","etag":null,"topics":["deno","jsr"],"latest_commit_sha":null,"homepage":"https://jsr.io/@brettchalupa/deno-disk-usage","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brettchalupa.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}},"created_at":"2024-12-22T03:18:48.000Z","updated_at":"2024-12-22T03:54:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"01a5fdc3-5aa2-4e0e-8eab-95a637c53227","html_url":"https://github.com/brettchalupa/deno_disk_usage","commit_stats":null,"previous_names":["brettchalupa/deno_disk_usage"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brettchalupa/deno_disk_usage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettchalupa%2Fdeno_disk_usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettchalupa%2Fdeno_disk_usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettchalupa%2Fdeno_disk_usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettchalupa%2Fdeno_disk_usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brettchalupa","download_url":"https://codeload.github.com/brettchalupa/deno_disk_usage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettchalupa%2Fdeno_disk_usage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["deno","jsr"],"created_at":"2024-12-23T01:27:15.160Z","updated_at":"2026-04-30T15:31:22.813Z","avatar_url":"https://github.com/brettchalupa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno Disk Usage\n\nA simple program and function to determine disk usage from a Deno program.\n\nDeno does not include anything in its stdlib that returns disk size, usage, and\nfree space. So this parses out the results of the `df` command, which is wildly\navailable on \\*nix systems.\n\nIt's unclear how precise the data is (as in I never heard of a mebibyte before\nwriting this code), but it's good enough for some simple checking and\nmonitoring.\n\nIdeally Deno would include this data like it does for CPU and RAM. Another\noption could be to try to use the Rust\n[sysinfo](https://crates.io/crates/sysinfo) crate to get these details.\n\n## Run\n\nOn macOS, here's how this could be used:\n\n```\ndeno run --allow-run jsr:@brettchalupa/deno-disk-usage/cli /System/Volumes/Data\n```\n\nYou can pass multiple disks in as separate args.\n\nWhich outputs:\n\n```console\n/System/Volumes/Data disk usage: 66 %\n/System/Volumes/Data used: 290010 MB\n/System/Volumes/Data used: 471482 MB\n```\n\n## Use the Function\n\nDrop the `DiskUsage` interface and the `getDiskUsage()` function into your\nproject and then call it:\n\n```ts\nimport { getDiskUsage } from \"jsr:@brettchalupa/deno-disk-usage\";\n\nconst diskUsage = await getDiskUsage();\n\nconsole.log(`${diskUsage.percentageUsed}% of ${diskUage.path} disk used`);\n```\n\nOr add it to your Deno project with:\n\n```\ndeno add jsr:@brettchalupa/deno-disk-usage\n```\n\nAnd import it with:\n\n```ts\nimport { getDiskUsage } from \"@brettchalupa/deno-disk-usage\";\n```\n\n## License\n\nUnlicense - Public Domain\n\n---\n\n## Dev Notes\n\nNew versions are automatically published when code is pushed to `main` with a\nbumped `version` in `deno.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettchalupa%2Fdeno_disk_usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrettchalupa%2Fdeno_disk_usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettchalupa%2Fdeno_disk_usage/lists"}