{"id":15780306,"url":"https://github.com/lunatic-fox/lext","last_synced_at":"2025-03-31T16:34:47.552Z","repository":{"id":140798098,"uuid":"485576103","full_name":"lunatic-fox/lext","owner":"lunatic-fox","description":"Extension methods to Lua language.","archived":false,"fork":false,"pushed_at":"2023-03-30T08:16:45.000Z","size":209,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-04T18:41:44.613Z","etag":null,"topics":["array","contains","extension","filter","flat","lua","map","module","reduce","replace","reverse","slice","split","string","table","trim"],"latest_commit_sha":null,"homepage":"","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/lunatic-fox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"lunatic-fox","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://github.com/lunatic-fox/lunatic-fox/tree/main/crypto-donations"]}},"created_at":"2022-04-26T00:15:43.000Z","updated_at":"2023-03-30T08:25:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"de0a9d35-0002-4972-b24e-0d33dd1becae","html_url":"https://github.com/lunatic-fox/lext","commit_stats":null,"previous_names":["lunatic-fox/lext"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-fox%2Flext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-fox%2Flext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-fox%2Flext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-fox%2Flext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunatic-fox","download_url":"https://codeload.github.com/lunatic-fox/lext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246498444,"owners_count":20787315,"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":["array","contains","extension","filter","flat","lua","map","module","reduce","replace","reverse","slice","split","string","table","trim"],"created_at":"2024-10-04T18:41:11.803Z","updated_at":"2025-03-31T16:34:47.520Z","avatar_url":"https://github.com/lunatic-fox.png","language":"Lua","funding_links":["https://github.com/sponsors/lunatic-fox","https://github.com/lunatic-fox/lunatic-fox/tree/main/crypto-donations"],"categories":[],"sub_categories":[],"readme":"[//]: # (author: Lunatic Fox - Josélio Júnior \u003cjoseliojrx25@gmail.com\u003e)\n[//]: # (copyright: Lunatic Fox - Josélio Júnior 2023)\n[//]: # (license: MIT)\n\n\u003cdiv align=\"right\"\u003e\n  \u003ca href=\"https://github.com/lunatic-fox/lunatic-fox/tree/main/crypto-donations\"\u003e\n    \u003cimg src=\"https://shields.io/badge/Crypto-Donations-098213?logo=bitcoin\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/sponsors/lunatic-fox\"\u003e\n    \u003cimg title=\"Donation page\" src=\"https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# Lua extensions \u0026nbsp;![](https://gh-tags.vercel.app/api?lang=lua)\n\n\n## Install\n\n### Step 1\n\u0026emsp;Download the [**`install.tar`**](https://github.com/lunatic-fox/lua-extensions/raw/develop/install/install.tar) file (Lua extensions directory), extract to your `LUA_PATH` (path where Lua is installed).\n\n\u0026emsp;Or you can also open a terminal in the same path where you downloaded `install.tar` and run the command line below to unzip to your `\u003cLUA_PATH\u003e`.\n\n```\ntar -xf install.tar -C \"\u003cLUA_PATH\u003e\"\n```\n\n#### install.tar\n\u003e **SHA256:** *cb4df36c5d5f86f92cc27d72b8e5b3c4e7fe7b7c8181a1e9d66f5968bef1032f*\\\n\u003e **MD5:** *bf6f95cd6d895dc0a5150ec738ad94eb*\n\u003e\n\u003e #### Content\n\u003e - `lext.lua`\n\u003e - `lua-extensions/dependencies/erros.lua`\n\u003e - `lua-extensions/dependencies/short-methods.lua`\n\u003e - `lua-extensions/docs/extlib.lua`\n\u003e - `lua-extensions/array.lua`\n\u003e - `lua-extensions/string.lua`\n\u003e - `lua-extensions/LICENSE.lua`\n\n\n### Step 2\n\u0026emsp;On VSCode you will need [**Lua Language Server**](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) extension installed.\n\n### Step 3\n\u0026emsp;Still on VSCode open `Preferences: Open User Settings (JSON)` with the command:\n- On Windows: `Ctrl + Shift + P` or `F1`\n- On MacOS: `⇧⌘P` or `F1`\n\n\u0026emsp;Inside the main object of `settings.json` add the code below changing `\u003cLUA_PATH\u003e` to the path where Lua is installed on your machine.\n\n```json\n\"Lua.workspace.library\": [\n  \"\u003cLUA_PATH\u003e/lua-extensions/docs\"\n]\n```\n\n\u0026emsp;All set! You're ready to go! 🚀\n\n## Usage\n\n\u0026emsp;Require Lua extensions module in whatever lua file you want with the code below.\n\n```lua\nrequire 'lext'\n```\n\n\u0026emsp;Let's see an example with `array.reduce()`.\n```lua\nrequire 'lext'\nlocal t = array{1, 2, 3, 4, 5}.reduce'+'\n\nprint(t) -- 15\n```\n\n## [Documentation](./docs/README.md)\n### UTF8 terminal\n\u0026emsp;If your terminal isn't displaying utf8 characters correctly, use the `utf8` option after the filename, just once. This argument triggers the `chcp 65001` command in the console.\n\n```lua\n-- heart.lua\nprint 'Coração' -- Cora├º├úo\n```\n\n```\n\u003e lua heart.lua utf8\n```\n\n\u003cbr/\u003e\n\n\u0026emsp;Now let's take a look at some brief explanations about the powerful Lua extensions. You can also click on the method to see some examples in [documentation](./docs/README.md).\n\n### [string](./docs/README.md#string)\n- [`:split()`](./docs/README.md#stringsplit)\\\n*Splits a string into a string table.*\n\n- [`:slice()`](./docs/README.md#stringslice)\\\n*Splices the string with UTF8 support.*\n\n- [`:replace()`](./docs/README.md#stringreplace)\\\n*Replaces a string substring with no magic symbols.*\n\n- [`:tolowercase()`](./docs/README.md#stringtolowercase)\\\n*Lowercase all with UTF8 support.*\n\n- [`:touppercase()`](./docs/README.md#stringtouppercase)\\\n*Lowercase all with UTF8 support.*\n\n- [`:reverse()`](./docs/README.md#stringreverse)\\\n*Reverses the string with UTF8 support.*\n\n- [`:contains()`](./docs/README.md#stringcontains)\\\n*Checks if the given string contains a certain substring.*\n\n- [`:trim()`](./docs/README.md#stringtrim)\\\n*Removes the leading and trailing white space line terminator characters from a string.*\n\n- [`:trimstart()`](./docs/README.md#stringtrimstart)\\\n*Removes the leading white space characters from a string.*\n\n- [`:trimend()`](./docs/README.md#stringtrimend)\\\n*Removes the trailing white space line terminator characters from a string.*\n\n### [array](./docs/README.md#array)\n- [`.join()`](./docs/README.md#arrayjoin)\\\n*Joins the table into a string.*\n\n- [`.slice()`](./docs/README.md#arrayslice)\\\n*Slices the table.*\n\n- [`.filter()`](./docs/README.md#arrayfilter)\\\n*Returns a table with items that meet a specified condition passed by a callback function.*\n\n- [`.map()`](./docs/README.md#arraymap)\\\n*Modifies each item of the table by a callback function.*\n\n- [`.reduce()`](./docs/README.md#arrayreduce)\\\n*Returns the accumulated result of all the elements in the array.*\n\n- [`.reverse()`](./docs/README.md#arrayreverse)\\\n*Reverses the order of the elements in the array.*\n\n- [`.flat()`](./docs/README.md#arrayflat)\\\n*Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.*\n\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️**\n\n**Lunatic Fox - Josélio Júnior - 2023**\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunatic-fox%2Flext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunatic-fox%2Flext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunatic-fox%2Flext/lists"}