{"id":23401732,"url":"https://github.com/joshuavandaele/lua-utilities-snippets","last_synced_at":"2025-10-10T06:13:15.466Z","repository":{"id":128951578,"uuid":"95463706","full_name":"JoshuaVandaele/Lua-Utilities-Snippets","owner":"JoshuaVandaele","description":"Useful Utilities/Snippets for Lua!","archived":false,"fork":false,"pushed_at":"2024-11-12T16:52:34.000Z","size":107,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T19:13:02.024Z","etag":null,"topics":["embeddable","free-to-use","io","lua","math","os","snippets","string","table","toolkit","utility","utility-function","utility-library","utility-scripts","utils"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoshuaVandaele.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,"zenodo":null}},"created_at":"2017-06-26T15:53:31.000Z","updated_at":"2024-11-12T16:52:44.000Z","dependencies_parsed_at":"2025-04-11T19:12:36.586Z","dependency_job_id":"0107271b-a8b0-4b09-b44b-530351e05a69","html_url":"https://github.com/JoshuaVandaele/Lua-Utilities-Snippets","commit_stats":null,"previous_names":["joshuavandaele/lua-utilities-snippets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JoshuaVandaele/Lua-Utilities-Snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshuaVandaele%2FLua-Utilities-Snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshuaVandaele%2FLua-Utilities-Snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshuaVandaele%2FLua-Utilities-Snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshuaVandaele%2FLua-Utilities-Snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshuaVandaele","download_url":"https://codeload.github.com/JoshuaVandaele/Lua-Utilities-Snippets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshuaVandaele%2FLua-Utilities-Snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002965,"owners_count":26083487,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["embeddable","free-to-use","io","lua","math","os","snippets","string","table","toolkit","utility","utility-function","utility-library","utility-scripts","utils"],"created_at":"2024-12-22T11:18:20.525Z","updated_at":"2025-10-10T06:13:15.436Z","avatar_url":"https://github.com/JoshuaVandaele.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utils\nUseful Utilities for Lua!\n\nThis file was made firstly for myself, but then I wanted to share it with people, so here it is!\n\n# Utilities avaible:\n## String\n * `string.random(count,min,max) ` \n\"count, min, max\" are not required, this function returns a random string\n* `string.split(str,split)`\nthis function splits a string to a table\n* `string.mix(str)`\nsee `mix`\n* `string.startswith(str,pattern)`\nverify if a string starts with the pattern\n* `string.endswith(str,pattern)`\nsame as above but for the end of the string\n* `string.encode`\ntable for encoding\n* `string.decode`\ntable for decoding\n* `string.encode.hex(str)`\nencode a string into hex\n* `string.decode.hex(str)`\ndecode a string into hex\n* `string.encode.b64(str)`\nencode a string into base64\n* `string.decode.b64(str)`\ndecode a string into base64\n* `string.totable`\ntransforms a string to a table\n\n## I/O\n* `io.readfile(path/to/file.txt)`\nreads a file\n* `io.store(file,content,true)`\nstores data into a file, the \"true\" mean we do a new line at the end of the file for future storing\n\n## Math\n* `math.mix`\nsee  `mix`\n* `math.calc`\nCalculator sandboxed (You can't inject code)\n\n## OS\n* `os.find(\"file\",\"dir\")`\nsearch for a file in a directory\n* `os.clear()`\nclear the terminal, works with all OS\n* `os.getOS()`\nreturns the current OS\n* `os.getArch()`\nget if the arch is 64 bits or 32 bits\n* `os.outputexec`   \nGet the output of a system command\n* `os.splitpath(path)`\nSplits the path\n## Table\n* `table.merge(t1,t2)`\nmerges two tables\n* `table.to2D(str)`\nreturns a 2D table version of the string you sent\n* `table.tostring(tbl)`\nreturns a string of the table you sent\n* `table.list(tbl)`\nreturn in a string a list of elements of a table, also returns count\n* `table.head(tbl)`\nreturns first value\n* `table.tail(tbl)`\nreturns the tail of the table\n* `table.find(tbl)`\nfind a value in a table\n* `table.reverse(tbl)`\nreverses a table. Warning: only works with normal keys (1,2,3..)\n\n## Console\n* `console.log(str)`\nlogs something with time and date\n* `console.slowPrint(str)`\nprints something slowly\n* `console.slowWrite(str)`\nwrites something slowly (using io.write)\n* `console.error(error type, error message, additional infos)`\nadvanced erroring\n* `console.update(bool,str...)`\nWill update the console, bool: is the text slowly appearing.\n\n## Others\n* `sleep(t)`\nwill wait the amount of time given\n* `operator`\nOperators, can always be useful\n* `morse`\nA table with char for morse in it\n* `chars`\na string with all chars, used for  `string.encode.b64(str)`\n* `mix`\nmix a string or ints\n* `dostring`\na remake of the old loadstring for Lua 5.3 - execute a string as a piece of code\n* `isType`\nShorter for type(obj) == \"obj\"","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuavandaele%2Flua-utilities-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshuavandaele%2Flua-utilities-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuavandaele%2Flua-utilities-snippets/lists"}