{"id":22562228,"url":"https://github.com/preciz/tmp","last_synced_at":"2025-10-12T18:55:45.574Z","repository":{"id":40562502,"uuid":"287980430","full_name":"preciz/tmp","owner":"preciz","description":"Temporary monitored directories in Elixir.","archived":false,"fork":false,"pushed_at":"2025-01-01T14:03:05.000Z","size":72,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T02:19:45.160Z","etag":null,"topics":["directory","elixir","temporary","tmp"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/tmp","language":"Elixir","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/preciz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-16T16:21:33.000Z","updated_at":"2025-07-08T21:25:45.000Z","dependencies_parsed_at":"2023-12-15T02:48:27.784Z","dependency_job_id":"c28d14e8-08bf-491e-a20a-518513293de0","html_url":"https://github.com/preciz/tmp","commit_stats":{"total_commits":69,"total_committers":3,"mean_commits":23.0,"dds":"0.26086956521739135","last_synced_commit":"4bb019f54a0d79de7030d9343ac3c59a0c6f19bf"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/preciz/tmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Ftmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Ftmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Ftmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Ftmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preciz","download_url":"https://codeload.github.com/preciz/tmp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Ftmp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012527,"owners_count":26085135,"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-10-12T02:00:06.719Z","response_time":53,"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":["directory","elixir","temporary","tmp"],"created_at":"2024-12-07T22:12:09.140Z","updated_at":"2025-10-12T18:55:45.529Z","avatar_url":"https://github.com/preciz.png","language":"Elixir","readme":"# Tmp\n\n[![test](https://github.com/preciz/tmp/actions/workflows/test.yml/badge.svg)](https://github.com/preciz/tmp/actions/workflows/test.yml)\n\nTemporary directories that are monitored and automatically removed in Elixir.\n\n## Installation\n\nThe package can be installed by adding `tmp` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:tmp, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\n## Usage\n\nDefine your Tmp module:\n\n```elixir\ndefmodule MyApp.Tmp do\n  use Tmp\nend\n\n# Or with a custom base directory\ndefmodule MyApp.CustomTmp do\n  use Tmp, base_dir: \"/path/where/tmp/dirs/will/be\"\nend\n```\n\nAdd it to your supervision tree:\n\n```elixir\nchildren = [\n  {MyApp.Tmp, name: MyApp.Tmp}\n]\n```\n\nUse it in your code:\n\n```elixir\nMyApp.Tmp.dir(fn tmp_dir_path -\u003e\n  file_path = Path.join(tmp_dir_path, \"my_file\")\n  # do work with file_path...\n  # then return a value\n  Enum.sum([1,2,3])\nend)\n# =\u003e 6\n```\n\n### Options\n\nWhen calling `MyApp.Tmp.dir/2`, you can pass the following options:\n\n- `:prefix` (optional) - Prefix for the temporary directory name, defaults to `nil`\n- `:base_dir` (optional) - Base directory for the temporary directory, defaults to `System.tmp_dir()` or the value set in `use Tmp`\n- `:timeout` (optional) - Timeout in milliseconds, defaults to `:infinity`\n\n### More Examples\n\n```elixir\nMyApp.Tmp.dir(fn tmp_dir_path -\u003e\n  File.touch(Path.join(tmp_dir_path, \"file_one\"))\n  # ... other important work\n\n  2 + 2\nend, prefix: \"my_app\", base_dir: \"/tmp/custom_base\")\n# =\u003e 4\n```\n\n## Docs\n\nDocumentation can be found at [https://hexdocs.pm/tmp](https://hexdocs.pm/tmp).\n\n## License\n\nTmp is [MIT licensed](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreciz%2Ftmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreciz%2Ftmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreciz%2Ftmp/lists"}