{"id":18489155,"url":"https://github.com/hachreak/sf","last_synced_at":"2025-04-08T21:30:42.022Z","repository":{"id":46099860,"uuid":"109720917","full_name":"hachreak/sf","owner":"hachreak","description":"An OTP library to format a string.","archived":false,"fork":false,"pushed_at":"2022-07-21T09:21:44.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T18:11:14.086Z","etag":null,"topics":["erlang","erlang-libraries","erlang-library","string-formatter"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/hachreak.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-11-06T16:31:56.000Z","updated_at":"2023-06-17T06:56:27.000Z","dependencies_parsed_at":"2022-09-01T09:40:13.532Z","dependency_job_id":null,"html_url":"https://github.com/hachreak/sf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Fsf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Fsf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Fsf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Fsf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hachreak","download_url":"https://codeload.github.com/hachreak/sf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247931033,"owners_count":21020155,"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":["erlang","erlang-libraries","erlang-library","string-formatter"],"created_at":"2024-11-06T12:55:36.830Z","updated_at":"2025-04-08T21:30:41.719Z","avatar_url":"https://github.com/hachreak.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"sf (String Formatter)\n=====================\n\nAn OTP library to format a string.\n\nUse\n---\n\nrebar.config\n\n```erlang\n{deps, [\n  {sf,\n    {git, \"https://github.com/hachreak/sf.git\", {branch, master}}}\n]}.\n```\n\nHow to format a binary:\n\n```erlang\n\u003c\u003c\"Hello worlds! The answer is: 42\"\u003e\u003e =\n    sf:format(\u003c\u003c\"Hello {{name}}! The answer is: {{answer}}\"\u003e\u003e,\n              [{name, \u003c\u003c\"worlds\"\u003e\u003e}, {answer, 42}]).\n```\n\nOr (passing a map):\n\n```erlang\n\u003c\u003c\"Hello worlds! The answer is: 42\"\u003e\u003e =\n    sf:format(\u003c\u003c\"Hello {{name}}! The answer is: {{answer}}\"\u003e\u003e,\n              #{name =\u003e \u003c\u003c\"worlds\"\u003e\u003e, answer =\u003e 42}).\n```\n\nHow to format a string:\n\n```erlang\n\"Hello worlds!\" = sf:format(\n      \u003c\u003c\"Hello {{name}}!\"\u003e\u003e, [{name, \u003c\u003c\"worlds\"\u003e\u003e}], [string]).\n```\n\nHow to format a atom:\n\n```erlang\n'Hello worlds!' = sf:format(\n      \u003c\u003c\"Hello {{name}}!\"\u003e\u003e, [{name, \u003c\u003c\"worlds\"\u003e\u003e}], [atom]).\n```\n\nConvert to string:\n\n```erlang\n\"test\" = sf:to_string(test).\n\"test\" = sf:to_string(\"test\").\n\"test\" = sf:to_string(\u003c\u003c\"test\"\u003e\u003e).\n\"123\" = sf:to_string(123).\n\"12.3\" = sf:to_string(12.3).\n\"\u003c0.60.0\u003e\" = sf:to_string(self()).\n\"{1,2,3}\" = sf:to_string({1,2,3}).\n\nBuild\n-----\n\n    $ rebar3 compile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhachreak%2Fsf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhachreak%2Fsf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhachreak%2Fsf/lists"}