{"id":15010140,"url":"https://github.com/wnuqui/presence","last_synced_at":"2025-04-09T18:05:09.746Z","repository":{"id":47627895,"uuid":"86595645","full_name":"wnuqui/presence","owner":"wnuqui","description":"Presence is very small library for Elixir projects that checks if a value is blank.","archived":false,"fork":false,"pushed_at":"2021-08-20T20:29:06.000Z","size":34,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T06:49:31.437Z","etag":null,"topics":["blank","elixir","presence","present","protocol"],"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/wnuqui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-29T14:57:16.000Z","updated_at":"2023-03-10T09:29:28.000Z","dependencies_parsed_at":"2022-07-22T12:32:43.903Z","dependency_job_id":null,"html_url":"https://github.com/wnuqui/presence","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Fpresence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Fpresence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Fpresence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Fpresence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wnuqui","download_url":"https://codeload.github.com/wnuqui/presence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084273,"owners_count":21045123,"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":["blank","elixir","presence","present","protocol"],"created_at":"2024-09-24T19:30:45.132Z","updated_at":"2025-04-09T18:05:09.725Z","avatar_url":"https://github.com/wnuqui.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Presence [![Build Status](https://travis-ci.org/wnuqui/presence.png?branch=master)](https://travis-ci.org/wnuqui/presence) [![Coverage Status](https://coveralls.io/repos/github/wnuqui/presence/badge.svg?branch=master)](https://coveralls.io/github/wnuqui/presence?branch=master) [![Inline docs](http://inch-ci.org/github/wnuqui/presence.svg)](http://inch-ci.org/github/wnuqui/presence) [![Release](http://img.shields.io/github/release/wnuqui/presence.svg)](https://github.com/wnuqui/presence/releases/latest) [![Hex Version](https://img.shields.io/hexpm/v/presence.svg \"Hex Version\")](https://hex.pm/packages/presence) [![Ebert](https://ebertapp.io/github/wnuqui/presence.svg)](https://ebertapp.io/github/wnuqui/presence)\n\nPresence is very small library for Elixir projects that needs to check if a value is blank. A value is blank if it's nil, false, empty, or a whitespace string.\n\nThe complete documentation for Presence is located [here](https://hexdocs.pm/presence).\n\n## Getting Started\n\nSome examples can be found below, but I highly recommend you review the\nAPI docs [here](https://hexdocs.pm/presence). There are examples for `Atom`, `BitString`, `Float`, `Integer`, `List`, `Map` and `Tuple`.\n\n### Adding Presence To Your Project\n\nTo use Presence with your projects, edit your `mix.exs` file and add it as a dependency:\n\n```elixir\ndefp deps do\n  [{:presence, \"~\u003e 0.9.1\"}]\nend\n```\n\n### Examples\n\nTo use Presence, I recommend you add\n```elixir\nimport Presence\n```\nto the top of the module where you will be working with Presence module. We `import` to easily access functions from modules implementing `Presence` protocol without using the fully-qualified name.\n\nThese functions are `is_blank/1`, `is_present/1`, `presence/1`\n\nFew examples below:\n\n```elixir\niex\u003e is_blank(nil)\ntrue\n```\n\n```elixir\niex\u003e is_blank([])\ntrue\n```\n\n```elixir\niex\u003e is_blank(%{})\ntrue\n```\n\n```elixir\niex\u003e is_present({:ok, %{data: [1, 2, 3]}})\ntrue\n```\n\n```elixir\niex\u003e is_present({})\nfalse\n```\n\n```elixir\niex\u003e presence(\"    \")\nnil\n```\n\n## Current Implementation\n\nPresence is a Protocol that is currently implemented by the following:\n- `Atom`\n- `BitString`\n- `Float`\n- `Integer`\n- `List`\n- `Map`\n- `Tuple`\n\nOther modules can implement the Protocol by defining these functions:\n- `is_blank/1`\n- `is_present/1`\n- `presence/1`\n\n## Inspiration\n\nMany thanks to [Rails](http://rubyonrails.org/) for the inspiration.\n\n## License\n\nThis software is licensed under [the MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnuqui%2Fpresence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwnuqui%2Fpresence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnuqui%2Fpresence/lists"}