{"id":18809892,"url":"https://github.com/bytebit-org/roblox-readonly","last_synced_at":"2026-05-10T05:40:36.866Z","repository":{"id":57683514,"uuid":"472502433","full_name":"Bytebit-Org/roblox-Readonly","owner":"Bytebit-Org","description":"Just a simple function that is really only useful in roblox-ts for forcing the value to be inferred as readonly.","archived":false,"fork":false,"pushed_at":"2022-04-05T05:05:31.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T00:47:58.111Z","etag":null,"topics":["game-development","lua","luau","npm-package","roblox","roblox-ts"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Bytebit-Org.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-03-21T20:31:38.000Z","updated_at":"2022-03-21T20:49:32.000Z","dependencies_parsed_at":"2022-09-05T16:41:22.701Z","dependency_job_id":null,"html_url":"https://github.com/Bytebit-Org/roblox-Readonly","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/Bytebit-Org%2Froblox-Readonly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-Readonly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-Readonly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-Readonly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bytebit-Org","download_url":"https://codeload.github.com/Bytebit-Org/roblox-Readonly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239743899,"owners_count":19689563,"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":["game-development","lua","luau","npm-package","roblox","roblox-ts"],"created_at":"2024-11-07T23:18:08.260Z","updated_at":"2026-05-10T05:40:36.830Z","avatar_url":"https://github.com/Bytebit-Org.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Readonly\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Bytebit-Org/roblox-Readonly/actions\"\u003e\n      \u003cimg src=\"https://github.com/Bytebit-Org/roblox-Readonly/workflows/CI/badge.svg\" alt=\"CI status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-blue.svg\" alt=\"PRs Welcome\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/QEz3v8y\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord\u0026longCache=true\u0026style=flat\" alt=\"Discord server\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nReadonly is just a simple function that is really only useful in roblox-ts for forcing the value to be inferred as readonly. Note that it is not a deep readonly - nested objects will still be just as mutable as they were without this function.\n\n## Installation\n### roblox-ts\nSimply install to your [roblox-ts](https://roblox-ts.com/) project as follows:\n```\nnpm i @rbxts/readonly\n```\n\n## Documentation\nDocumentation can be found [here](https://github.com/Bytebit-Org/roblox-Readonly/tree/master/docs), is included in the TypeScript files directly, and was generated using [TypeDoc](https://typedoc.org/).\n\n## Example\nHere's a simple example of just getting a reference to an object and forcing the reference to be marked as readonly. Note that the nested value is still mutable.\n\n```ts\nimport { readonly } from \"@rbxts/readonly\";\n\ntype SomeValue = {\n  message: string,\n  someOtherValue: SomeValue,\n};\n\ndeclare function getSomeValue(): SomeValue;\n\nexport class Foo {\n  public bar() {\n    const value = readonly(getSomeValue());\n\n\tvalue.someOtherValue.message = \"can mutate this\"; // perfectly fine\n\tvalue.message = \"can't mutate this\"; // TypeScript error\n\n    // more logic\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebit-org%2Froblox-readonly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebit-org%2Froblox-readonly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebit-org%2Froblox-readonly/lists"}