{"id":24388773,"url":"https://github.com/warmwaffles/omnipresence","last_synced_at":"2026-05-21T12:03:39.666Z","repository":{"id":64071950,"uuid":"573179968","full_name":"warmwaffles/omnipresence","owner":"warmwaffles","description":"Presence checking protocol for elixir","archived":false,"fork":false,"pushed_at":"2023-08-31T22:39:10.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-20T20:17:36.354Z","etag":null,"topics":["elixir","elixir-library"],"latest_commit_sha":null,"homepage":"","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/warmwaffles.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}},"created_at":"2022-12-01T21:49:02.000Z","updated_at":"2023-08-31T22:26:00.000Z","dependencies_parsed_at":"2022-12-02T01:02:47.703Z","dependency_job_id":null,"html_url":"https://github.com/warmwaffles/omnipresence","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/warmwaffles%2Fomnipresence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warmwaffles%2Fomnipresence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warmwaffles%2Fomnipresence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warmwaffles%2Fomnipresence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warmwaffles","download_url":"https://codeload.github.com/warmwaffles/omnipresence/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243297133,"owners_count":20268718,"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","elixir-library"],"created_at":"2025-01-19T14:29:13.811Z","updated_at":"2025-12-25T13:22:11.373Z","avatar_url":"https://github.com/warmwaffles.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Omnipresence\n\nYet another presence checker for elixir.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `omnipresence` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:omnipresence, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\nimport Omnipresence\n\nif present?(calculated_value()) do\n  IO.puts(\"I'm present\")\nelse\n  IO.puts(\"I'm blank\")\nend\n\nif blank?(nil) do\n  IO.puts(\"I'm blank\")\nend\n```\n\n```elixir\nraw_value\n|\u003e some_function()\n|\u003e Stream.map(\u0026Omnipresence.presence/1)\n|\u003e Stream.reject(\u0026is_nil/1)\n|\u003e Enum.each(fn value -\u003e\n  IO.inspect(value)\nend)\n```\n\n## Imlementing Your Own\n\n```elixir\ndefmodule Dog do\n  defstruct [:name, :age]\nend\n\ndefimpl Omnipresence, for: Dog do\n  def present?(%Dog{name: nil, age: nil}), do: false\n  def present?(_), do: true\n\n  def blank?(dog), do: !present?(dog)\n\n  def presence(%Dog{name: nil, age: nil}), do: nil\n  def presence(dog), do: dog\nend\n```\n\n```elixir\nOmnipresence.present?(%Dog{name: \"Frank\", age: 2}) #=\u003e true\nOmnipresence.present?(%Dog{name: nil, age: nil})   #=\u003e false\n\nOmnipresence.blank?(%Dog{name: \"Frank\", age: 2})   #=\u003e false\nOmnipresence.blank?(%Dog{name: nil, age: nil})     #=\u003e true\n\nOmnipresence.presence(%Dog{name: \"Frank\", age: 2}) #=\u003e %Dog{name: \"Frank\", age: 2}\nOmnipresence.presence(%Dog{name: nil, age: nil})   #=\u003e nil\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/omnipresence\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarmwaffles%2Fomnipresence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarmwaffles%2Fomnipresence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarmwaffles%2Fomnipresence/lists"}