{"id":17482914,"url":"https://github.com/creationix/redis-luvit","last_synced_at":"2026-03-06T01:02:15.302Z","repository":{"id":66014256,"uuid":"45975017","full_name":"creationix/redis-luvit","owner":"creationix","description":"A redis client for luvit","archived":false,"fork":false,"pushed_at":"2017-03-04T05:22:44.000Z","size":14,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T02:55:39.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/creationix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-11T10:27:21.000Z","updated_at":"2023-09-08T17:03:31.000Z","dependencies_parsed_at":"2023-03-27T23:17:13.738Z","dependency_job_id":null,"html_url":"https://github.com/creationix/redis-luvit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/creationix/redis-luvit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fredis-luvit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fredis-luvit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fredis-luvit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fredis-luvit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/redis-luvit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fredis-luvit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"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-10-18T23:47:46.266Z","updated_at":"2026-03-06T01:02:15.268Z","avatar_url":"https://github.com/creationix.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-luvit\n\nA [Redis][] protocol codec for [Luvit][]\n\n## Installing\n\nSimply install using lit directly:\n\n```sh\nlit install creationix/redis-client\n```\n\nOr add to your dependencies list.\n\n```lua\nexports.dependencies = {\n  \"creationix/redis-client\"\n}\n```\n\n## Usage\n\nThe redis client library wraps the raw codec in an easy to use coroutine based\ninterface using luvit streams.\n\nSend multiple strings to make a query and the response will come back\npre-decoded.\n\n```lua\nlocal connect = require('redis-client')\n\ncoroutine.wrap(function ()\n  -- Connect to redis\n  local send = connect { host = \"localhost\", port = 6379 }\n\n  -- Send some commands\n  send(\"set\", \"name\", \"Tim\")\n  local name = send(\"get\", \"name\")\n  assert(name == \"Tim\")\n\n  -- Close the connection\n  send()\nend)()\n```\n\n## Using the raw codec directly\n\nThis codec is transport agnostic.  I like to use it with the coro friendly\nlibraries, but it can be used with the node style streams in luvit or even\nwith a non-luvit lua project.\n\nIt is a simple encoder/decoder for talking [RESP][] over a socket.\n\nThe encoder is a simple function that accepts a table of strings and encodes\nit as a RESP list.  The decoder accepts a chunk of raw data string and tries to\nconsume one message.\n\nIf there is not enough data, it simply returns nothing.  If there is enough, it\nreturns the parsed value as well as the leftover data.\n\n```lua\nlocal codec = require('redis-codec')\n\nlocal encoded = codec.encode({\"set\", \"name\", \"Tim\"})\n\nlocal message, extra = codec.decode(\"$5\\r\\nHello\\r\\n+More\\r\\n\")\n```\n\n[Redis]: http://redis.io/\n[Luvit]: https://luvit.io/\n[RESP]: http://redis.io/topics/protocol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fredis-luvit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fredis-luvit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fredis-luvit/lists"}