{"id":13895315,"url":"https://github.com/fengari-lua/fengari-web","last_synced_at":"2025-04-05T16:04:22.291Z","repository":{"id":42056065,"uuid":"91235301","full_name":"fengari-lua/fengari-web","owner":"fengari-lua","description":"Provides everything you need to run Fengari in the browser.","archived":false,"fork":false,"pushed_at":"2021-06-23T16:13:02.000Z","size":433,"stargazers_count":263,"open_issues_count":12,"forks_count":18,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T15:04:00.003Z","etag":null,"topics":["fengari","html","lua"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/fengari-lua.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}},"created_at":"2017-05-14T10:15:18.000Z","updated_at":"2025-03-20T23:38:02.000Z","dependencies_parsed_at":"2022-09-14T12:20:44.033Z","dependency_job_id":null,"html_url":"https://github.com/fengari-lua/fengari-web","commit_stats":null,"previous_names":["fengari-lua/fengari-web-cli"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengari-lua","download_url":"https://codeload.github.com/fengari-lua/fengari-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361615,"owners_count":20926642,"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":["fengari","html","lua"],"created_at":"2024-08-06T18:02:07.782Z","updated_at":"2025-04-05T16:04:22.268Z","avatar_url":"https://github.com/fengari-lua.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/fengari-lua/fengari-web.svg?branch=master)](https://travis-ci.org/fengari-lua/fengari-web)\n[![npm](https://img.shields.io/npm/v/fengari-web.svg)](https://npmjs.com/package/fengari-web)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![#fengari on libera.chat](https://img.shields.io/badge/chat-%23fengari-brightgreen)](https://web.libera.chat/?channels=#fengari)\n\n\n# fengari-web\n\nProvides anything you need to run [Fengari](https://fengari.io) in the browser.\n\n## Getting started\n\n### Download\n\nVisit the [GitHub releases page](https://github.com/fengari-lua/fengari-web/releases) and get the latest version.\n\nAlternatively you can [Build](#Building) fengari-web yourself.\n\n\n### Directly\n\nLoad fengari-web in your web page:\n\n```html\n\u003cscript src=\"fengari-web.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nNow any script of type `application/lua` will be run by fengari:\n\n```html\n\u003cscript type=\"application/lua\"\u003e\nprint(\"Hello World!\")\n\u003c/script\u003e\n\n\u003cscript src=\"/my-script.lua\" type=\"application/lua\" async\u003e\u003c/script\u003e\n```\n\nNote that if you use a `src` attribute, it is strongly recommended for it to be [`async`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async).\n\n\n### With build process\n\nSee [fengari-loader](https://github.com/fengari-lua/fengari-loader/)\n\n\n## Compatibility\n\nfengari-web should work in all modern browsers.\n\nVerified to work in:\n\n  - Chrome \u003e= 38\n  - Firefox \u003e= 19\n  - Safari \u003e= 8\n  - Microsoft IE 11\n  - Microsoft Edge\n\n\n## API\n\nAs well as running `\u003cscript type=\"application/lua\"\u003e` tags, fengari-web creates a `fengari` global that contains the [core `fengari` API](https://github.com/fengari-lua/fengari#the-js-api) supplemented with:\n\n  - `L`: the main `lua_State` (in which script tags are run)\n  - `interop`: containing the [fengari-interop](https://github.com/fengari-lua/fengari-interop) library\n  - `load(source, chunkname)`: a function that loads the lua code in `source` with the optional chunk name `chunkname` and returns it as a function.\n    This function can be used to programmatically run lua code in the main `lua_State` from JavaScript. e.g.\n    ```js\n    console.log(fengari.load('return 1+1')())\n    ```\n\n\n## Building\n\n```bash\ngit clone https://github.com/fengari-lua/fengari-web.git\nnpm install\n```\n\nThis should automatically kick off the build process.\nThe built files can then be found in the `dist/` directory.\n\nIf you need to rebuild, run\n\n```bash\nnpm run build\n```\n\nOr [use `webpack` directly](https://webpack.js.org/api/cli/).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengari-lua%2Ffengari-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengari-lua%2Ffengari-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengari-lua%2Ffengari-web/lists"}