{"id":28114538,"url":"https://github.com/jheysaaz/directories-deno","last_synced_at":"2026-06-10T09:31:22.050Z","repository":{"id":57675519,"uuid":"377679144","full_name":"jheysaaz/directories-deno","owner":"jheysaaz","description":"a library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows.","archived":false,"fork":false,"pushed_at":"2026-03-15T17:12:11.000Z","size":47,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T00:27:38.155Z","etag":null,"topics":["deno","directories"],"latest_commit_sha":null,"homepage":"https://jsr.io/@jheysaaz/directories","language":"TypeScript","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/jheysaaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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}},"created_at":"2021-06-17T02:11:42.000Z","updated_at":"2026-03-15T17:12:14.000Z","dependencies_parsed_at":"2024-03-18T05:28:17.473Z","dependency_job_id":"16c73078-02bb-4acd-93fa-ebbbf9f21269","html_url":"https://github.com/jheysaaz/directories-deno","commit_stats":null,"previous_names":["jsaavedrazuniga/directories-deno","jheysaav/directories-deno"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jheysaaz/directories-deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jheysaaz%2Fdirectories-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jheysaaz%2Fdirectories-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jheysaaz%2Fdirectories-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jheysaaz%2Fdirectories-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jheysaaz","download_url":"https://codeload.github.com/jheysaaz/directories-deno/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jheysaaz%2Fdirectories-deno/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34042594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"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":["deno","directories"],"created_at":"2025-05-14T05:15:59.627Z","updated_at":"2026-06-10T09:31:22.018Z","avatar_url":"https://github.com/jheysaaz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# directories\n\n\u003e A Deno port of Rust's [`directories`](https://crates.io/crates/directories)\n\u003e crate. Provides platform-specific base, user, and project directories on\n\u003e Linux, macOS, and Windows.\n\n[![CI](https://github.com/jheysaaz/directories-deno/actions/workflows/ci.yml/badge.svg)](https://github.com/jheysaaz/directories-deno/actions/workflows/ci.yml)\n\n## Usage\n\n```typescript\nimport {\n  baseDirs,\n  projectDirs,\n  userDirs,\n} from \"https://deno.land/x/directories/mod.ts\";\n\nconst base = baseDirs.setup();\nconsole.log(base.cacheDir);\n// Linux:   /home/alice/.cache\n// macOS:   /Users/alice/Library/Caches\n// Windows: C:\\Users\\alice\\AppData\\Local\n\nconst user = userDirs.setup();\nconsole.log(user.musicDir);\n// Linux:   /home/alice/Music\n// macOS:   /Users/alice/Music\n// Windows: C:\\Users\\alice\\Music\n\nconst project = projectDirs.setup(\"com\", \"acme\", \"directories\");\nconsole.log(project.preferenceDir);\n// Linux:   /home/alice/.config/directories\n// macOS:   /Users/alice/Library/Preferences/com.acme.directories\n// Windows: C:\\Users\\alice\\AppData\\Roaming\\acme\\directories\n```\n\n## API\n\n### `baseDirs.setup(): BaseDirs`\n\nReturns platform-specific base directories. On Linux,\n[XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/latest/)\nenvironment variables are respected.\n\n| Field           | Linux                                 | macOS                           | Windows                         |\n| --------------- | ------------------------------------- | ------------------------------- | ------------------------------- |\n| `homeDir`       | `$HOME`                               | `$HOME`                         | `%USERPROFILE%`                 |\n| `cacheDir`      | `$XDG_CACHE_HOME` \\| `~/.cache`       | `~/Library/Caches`              | `%USERPROFILE%\\AppData\\Local`   |\n| `configDir`     | `$XDG_CONFIG_HOME` \\| `~/.config`     | `~/Library/Application Support` | `%USERPROFILE%\\AppData\\Roaming` |\n| `dataDir`       | `$XDG_DATA_HOME` \\| `~/.local/share`  | `~/Library/Application Support` | `%USERPROFILE%\\AppData\\Roaming` |\n| `dataLocalDir`  | same as `dataDir`                     | `~/Library/Application Support` | `%USERPROFILE%\\AppData\\Local`   |\n| `preferenceDir` | same as `configDir`                   | `~/Library/Preferences`         | `%USERPROFILE%\\AppData\\Roaming` |\n| `stateDir`      | `$XDG_STATE_HOME` \\| `~/.local/state` | same as `dataDir`               | same as `dataLocalDir`          |\n| `runtimeDir`    | `$XDG_RUNTIME_DIR` \\| `\"virtualHome\"` | `~/Library/Application Support` | `%USERPROFILE%\\AppData\\Local`   |\n| `executableDir` | `~/.local/bin`                        | `\"virtualHome\"`                 | `\"virtualHome\"`                 |\n\n### `userDirs.setup(): UserDirs`\n\nReturns platform-specific user directories. On Linux, XDG user-dir environment\nvariables (e.g. `XDG_MUSIC_DIR`) are respected.\n\n| Field         | Linux                                            | macOS             | Windows                                         |\n| ------------- | ------------------------------------------------ | ----------------- | ----------------------------------------------- |\n| `homeDir`     | `$HOME`                                          | `$HOME`           | `%USERPROFILE%`                                 |\n| `desktopDir`  | `$XDG_DESKTOP_DIR` \\| `~/Desktop`                | `~/Desktop`       | `~\\Desktop`                                     |\n| `documentDir` | `$XDG_DOCUMENTS_DIR` \\| `~/Documents`            | `~/Documents`     | `~\\Documents`                                   |\n| `downloadDir` | `$XDG_DOWNLOAD_DIR` \\| `~/Downloads`             | `~/Downloads`     | `~\\Downloads`                                   |\n| `musicDir`    | `$XDG_MUSIC_DIR` \\| `~/Music`                    | `~/Music`         | `~\\Music`                                       |\n| `pictureDir`  | `$XDG_PICTURES_DIR` \\| `~/Pictures`              | `~/Pictures`      | `~\\Pictures`                                    |\n| `videoDir`    | `$XDG_VIDEOS_DIR` \\| `~/Videos`                  | `~/Movies`        | `~\\Videos`                                      |\n| `publicDir`   | `$XDG_PUBLICSHARE_DIR` \\| `~/Public`             | `~/Public`        | `~\\Public`                                      |\n| `fontDir`     | `$XDG_DATA_HOME/fonts` \\| `~/.local/share/fonts` | `~/Library/Fonts` | `C:\\Windows\\fonts`                              |\n| `templateDir` | `$XDG_TEMPLATES_DIR` \\| `~/Templates`            | `\"virtualHome\"`   | `~\\AppData\\Roaming\\Microsoft\\Windows\\Templates` |\n| `trashDir`    | `~/.local/share/Trash`                           | `~/.Trash`        | `\"virtualHome\"`                                 |\n\n### `projectDirs.setup(qualifier, organization, application): ProjectDirs`\n\nReturns application-specific directories derived from `baseDirs`. Path format\nvaries per platform:\n\n- **Linux** — `\u003cbase\u003e/\u003capplication\u003e`\n- **macOS** — `\u003cbase\u003e/\u003cqualifier\u003e.\u003corganization\u003e.\u003capplication\u003e`\n- **Windows** — `\u003cbase\u003e\\\u003corganization\u003e\\\u003capplication\u003e`\n\n| Field           | Description                         |\n| --------------- | ----------------------------------- |\n| `cacheDir`      | Application cache directory         |\n| `configDir`     | Application configuration directory |\n| `dataDir`       | Application data directory          |\n| `dataLocalDir`  | Application local data directory    |\n| `preferenceDir` | Application preferences directory   |\n\n## Notes\n\n- Fields that have no meaningful value on a given platform return the string\n  `\"virtualHome\"` as a sentinel.\n- On Linux, `$HOME` falls back to `\"virtualHome\"` when the environment variable\n  is not set.\n\n## Development\n\n```sh\ndeno task test    # run tests\ndeno task check   # type-check\ndeno task lint    # lint\ndeno task fmt     # format\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjheysaaz%2Fdirectories-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjheysaaz%2Fdirectories-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjheysaaz%2Fdirectories-deno/lists"}