{"id":19723600,"url":"https://github.com/nitrogen/rekt","last_synced_at":"2026-03-08T21:02:31.137Z","repository":{"id":55041434,"uuid":"80667738","full_name":"nitrogen/rekt","owner":"nitrogen","description":"Erlang Record Extender (parse transform)","archived":false,"fork":false,"pushed_at":"2021-01-13T14:38:55.000Z","size":877,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-29T22:36:32.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/nitrogen.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-02-01T21:47:20.000Z","updated_at":"2023-09-06T02:35:13.000Z","dependencies_parsed_at":"2022-08-14T09:50:52.148Z","dependency_job_id":null,"html_url":"https://github.com/nitrogen/rekt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nitrogen/rekt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrogen%2Frekt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrogen%2Frekt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrogen%2Frekt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrogen%2Frekt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitrogen","download_url":"https://codeload.github.com/nitrogen/rekt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrogen%2Frekt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30273294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-11T23:22:51.126Z","updated_at":"2026-03-08T21:02:31.107Z","avatar_url":"https://github.com/nitrogen.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"rekt\n=====\n\nErlang Record Extender Parse Transform\n\nBuild\n-----\n\n    $ rebar3 compile\n\nUsage\n-----\n\n1) Add `rekt` to your rebar dependencies\n\n2) Include in your modules(if using with Nitrogen 2.4+, it's included by default):\n\n`-compile({parse_transform, rekt}).`\n\n3) Extend records:\n\n```erlang\n-extend({original_record, new_record, [\n    field1,   %% Just an atom for a field,\n    {field2, 2},    %% A field with a default value of 2\n    {field3, [a,b,c]},  %% a field with a default value of [a,b,c],\n    {field4, \"sometext\", \"string() | undefined\"} %% A field with a default value of\n                                                 %% \"sometext\", and supports types\n                                                 %% string() and undefined. Note,\n                                                 %% the typedef is the string\n                                                 %% of the typedef\n]}).\n```\n\n4) Enjoy being able to create new records from older records.\n\nNotes\n-----\n\n* You can replace fields with new field definitions. The fields will be replaced\nin-line.\n* You can extend previously extended records.\n\nExample\n-------\n```erlang\n-module(rekt_sample).\n-compile({parse_transform, rekt}).\n-export([do/0]).\n\n%% Create initial record\n-record(rec_1, {a=1, b=2, c=3}).\n\n%% Make new record called #rec_2{}, that is a copy of #rec_1{} with a new field called `y`\n-extend({rec_1, rec_2, [\n    {y, 1000}\n]}).\n\n%% Make a new record called #rec_3{} based on the previously created #rec_2{},\n%% with the `a` field replaced with a new definition (having a default value of\n%% \"newthing\")\n-extend({rec_2, rec_3, [\n    {a, \"newthing\"}\n]}).\n\ndo() -\u003e\n    io:format(\"Rec_1: ~p~n\",[#rec_1{}]),\n    io:format(\"Rec_2: ~p~n\",[#rec_2{}]),\n    io:format(\"Rec_3: ~p~n\",[#rec_3{}]).\n```\n\nThen run:\n\n```erlang\n\u003e rekt_sample:do().\nRec_1: {rec_1, 1, 2, 3}\nRec_2: {rec_2, 1, 2, 3, 1000}\nRec_3: {rec_3, \"newthing\", 2, 3, 1000}\nok\n```\n\nLicense\n-------\nCopyright 2017-2020 Jesse Gumm\n\nMIT LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrogen%2Frekt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitrogen%2Frekt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrogen%2Frekt/lists"}