{"id":22788586,"url":"https://github.com/ale32bit/requiredb","last_synced_at":"2025-07-08T01:12:05.537Z","repository":{"id":198055250,"uuid":"699984576","full_name":"Ale32bit/RequireDB","owner":"Ale32bit","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-05T08:32:09.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T16:24:33.746Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ale32bit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-10-03T18:09:14.000Z","updated_at":"2023-10-11T05:14:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"973abedd-3ba5-4cf7-9dff-acc641d0dfa5","html_url":"https://github.com/Ale32bit/RequireDB","commit_stats":null,"previous_names":["ale32bit/requiredb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ale32bit%2FRequireDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ale32bit%2FRequireDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ale32bit%2FRequireDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ale32bit%2FRequireDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ale32bit","download_url":"https://codeload.github.com/Ale32bit/RequireDB/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ale32bit%2FRequireDB/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259124212,"owners_count":22808892,"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":[],"created_at":"2024-12-12T01:32:51.502Z","updated_at":"2025-06-10T18:32:19.002Z","avatar_url":"https://github.com/Ale32bit.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RequireDB\n\nRepository of libraries for ComputerCraft\n\n## Usage\n\n1. Download [requiredb.lua](/requiredb.lua).\n\n    `wget https://raw.github.com/Ale32bit/RequireDB/main/requiredb.lua`\n\n2. Require the library to enable the functionality and then require the libraries you need by prepending the name with `@`. Additionally you can append the version after `:`. (i.e. `@example:0.0.1`)\n   \n   ```lua\n   local requiredb = require \"requiredb\"\n\n   local rdb = requiredb()\n\n   local example = require(\"@example\")\n   ```\n\n## Library Documentation\n\n`requiredb([options: table]): requireDb`\n\n### options\n\nThe optional options table defines the options to use.\n\n```lua\noptions = {\n    -- Path of the cache directory.\n    path?: string = \".requiredb\",\n\n    -- Upstream repository. NO LEADING SLASH.\n    repository?: string = \"https://requiredb.alexdevs.me\",\n\n    -- Use cache of previously downloaded libraries.\n    useCache?: boolean = true,\n}\n```\n\n### requireDb\n\nThis table is returned by creating a new instance.\n\nCreating the instance automatically injects the package loader and more can be stacked with different configurations.\n\n```lua\n-- Get the index.json of the library\nrequireDb.getInfo(name: string): table\n-- If the library license is \"custom\", a HTTP GET request is made to retrieve the LICENSE file from the repository and, if successfully downloaded, will replace  the \"license\" field.\n```\n\n## How to add a library\n\n1. Adding a library is as simple as creating a directory in the [packages/](/packages/) directory.\n\n    The library name in the directory must be alphanumeric and can include hyphens (`-`).\n\n2. Inside the newly created library directory, creare a new `index.json` file.\n\n    Fill the file content with this template. Remember to remove comments.\n\n    ```jsonc\n    {\n        // Pretty name of the library\n        \"name\": \"My Library\",\n\n        // All authors of the library\n        \"authors\": [\n            \"Myself\",\n            \"Someone else\"\n        ],\n\n        // License of the library. Set to \"custom\" if using a custom license.\n        // If \"custom\" is used, create and fill the file \"LICENSE\" in the same directory of this file index.json.\n        \"license\": \"My license\",\n\n        // Versions available to download.\n        // The last item is used as \"latest\" version.\n        \"versions\": [\n\n            // Strings refer to files in the repository\n            \"1.0.0\", \n\n            // Objects refer to files outside of repository\n            { \n                \"version\": \"1.0.1\",\n\n                // URL of the library code\n                \"upstream\": \"https://pastebin.com/raw/6UV4qfNF\", \n                \n                // SHA-256 hash of the file. This has to match with whatever SHA256 digets in CC.\n                \"hash\": \"086937fedfb9da1a0fc66164f189c5cd245f91be0b723b31cb384c6064b43470\",\n            },\n        ]\n\n        // Other fields can be included, such as \"website\".\n    }\n    ```\n\n3. Create the directory `versions` and insert all versions in respect of the versions array in `index.json`.\n\n    The files must end with `.lua`\n\n4. Create a pull request or host your own repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fale32bit%2Frequiredb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fale32bit%2Frequiredb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fale32bit%2Frequiredb/lists"}