{"id":19731378,"url":"https://github.com/cargosense/briefly","last_synced_at":"2025-04-08T10:33:24.080Z","repository":{"id":37768913,"uuid":"41848331","full_name":"CargoSense/briefly","owner":"CargoSense","description":"Simple, robust temporary file support for Elixir.","archived":false,"fork":false,"pushed_at":"2024-01-19T19:40:20.000Z","size":108,"stargazers_count":273,"open_issues_count":3,"forks_count":33,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-09T13:50:55.869Z","etag":null,"topics":["elixir","phoenix","public"],"latest_commit_sha":null,"homepage":"http://hexdocs.pm/briefly","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CargoSense.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":"2015-09-03T07:58:40.000Z","updated_at":"2024-06-18T13:57:11.037Z","dependencies_parsed_at":"2024-01-19T20:46:56.701Z","dependency_job_id":"92be3ba8-d873-49d7-a3d4-6aa3d2f10f29","html_url":"https://github.com/CargoSense/briefly","commit_stats":{"total_commits":70,"total_committers":19,"mean_commits":"3.6842105263157894","dds":0.6857142857142857,"last_synced_commit":"20d1318ec22259923ebd94331c0227895f1faa70"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CargoSense%2Fbriefly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CargoSense%2Fbriefly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CargoSense%2Fbriefly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CargoSense%2Fbriefly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CargoSense","download_url":"https://codeload.github.com/CargoSense/briefly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247824287,"owners_count":21002242,"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":["elixir","phoenix","public"],"created_at":"2024-11-12T00:20:40.095Z","updated_at":"2025-04-08T10:33:24.057Z","avatar_url":"https://github.com/CargoSense.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Briefly\n\n[![Build Status](https://github.com/CargoSense/briefly/actions/workflows/main.yml/badge.svg)](https://github.com/CargoSense/briefly/actions/workflows/main.yml)\n[![Module Version](https://img.shields.io/hexpm/v/briefly.svg)](https://hex.pm/packages/briefly)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/briefly/)\n[![Total Download](https://img.shields.io/hexpm/dt/briefly.svg)](https://hex.pm/packages/briefly)\n[![License](https://img.shields.io/hexpm/l/briefly.svg)](https://github.com/CargoSense/briefly/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/CargoSense/briefly.svg)](https://github.com/CargoSense/briefly/commits/master)\n\n\u003c!-- MDOC --\u003e\n\nSimple, robust temporary file support for Elixir.\n\n## Highlighted Features\n\n* Create temporary files with prefix and extname options.\n* Files are removed after the requesting process exits.\n* File creation is based on [Plug.Upload](http://hexdocs.pm/plug/Plug.Upload.html)'s robust retry logic.\n* Configurable; built-in support for system environment variables and fallbacks.\n\n## Usage\n\nThe fastest way to use Briefly is with [`Mix.install/2`](https://hexdocs.pm/mix/Mix.html#install/2) (requires Elixir v1.12+):\n\n```elixir\nMix.install([\n  {:briefly, \"~\u003e 0.5.0\"}\n])\n\n{:ok, path} = Briefly.create()\nFile.write!(path, \"My temp file contents\")\nFile.read!(path)\n# =\u003e \"My temp file contents\"\n\n# When this process exits, the file at `path` is removed\n```\n\nIf you want to use Briefly in a Mix project, you can add the above dependency to your list of dependencies in `mix.exs`.\n\nTo use Briefly outside of the context of an application's dependency tree (e.g. in an .exs file), first run `Briefly.start`.\n\nBriefly can also create a temporary directory:\n\n\n```elixir\n{:ok, dir} = Briefly.create(type: :directory)\nFile.write!(Path.join(dir, \"test.txt\"), \"Some Text\")\n# When this process exits, the directory and file are removed\n```\n\nRefer to [the documentation](http://hexdocs.pm/briefly/Briefly.html#create/1) for a list of options that are available to `Briefly.create/1` and `Briefly.create!/1`.\n\n## Configuration\n\nThe default, out-of-the-box settings for Briefly are equivalent to the\nfollowing Mix config:\n\n```elixir\n# config/config.exs\nconfig :briefly,\n  directory: [{:system, \"TMPDIR\"}, {:system, \"TMP\"}, {:system, \"TEMP\"}, \"/tmp\"],\n  directory_mode: 0o755,\n  default_prefix: \"briefly\",\n  default_extname: \"\"\n```\n\n`directory` here declares an ordered list of possible directory definitions that Briefly will check in order.\n\nThe `{:system, env_var}` tuples point to system environment variables to be checked. If none of these are defined, Briefly will use the final entry: `/tmp`.\n\nYou can override the settings with your own candidates in your application Mix\nconfig (and pass `prefix` and `extname` to `Briefly.create` to override\n`default_prefix` and `default_extname` on a case-by-case basis).\n\n\u003c!-- MDOC --\u003e\n\n## License\n\nCopyright (c) 2023 CargoSense, Inc.\n\nPortions derived from Plug, https://github.com/elixir-lang/plug\nCopyright (c) 2013 Plataformatec\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n  \u003e http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcargosense%2Fbriefly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcargosense%2Fbriefly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcargosense%2Fbriefly/lists"}