{"id":13995991,"url":"https://github.com/rhaiscript/playground","last_synced_at":"2025-09-04T15:46:04.686Z","repository":{"id":44804582,"uuid":"273905492","full_name":"rhaiscript/playground","owner":"rhaiscript","description":"A Rhai scripting playground that runs Rhai scripts using WebAssembly in a web browser.","archived":false,"fork":false,"pushed_at":"2024-05-14T13:50:53.000Z","size":8028,"stargazers_count":23,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-25T08:36:08.282Z","etag":null,"topics":["playground","rhai","rhai-playground","scripting-language","webassembly"],"latest_commit_sha":null,"homepage":"https://rhai.rs/playground","language":"Vue","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/rhaiscript.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":"2020-06-21T13:03:52.000Z","updated_at":"2025-04-27T14:59:12.000Z","dependencies_parsed_at":"2024-02-01T05:37:08.805Z","dependency_job_id":"771928f9-d14f-4581-874c-e52d9905cf2e","html_url":"https://github.com/rhaiscript/playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhaiscript/playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Fplayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Fplayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Fplayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Fplayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaiscript","download_url":"https://codeload.github.com/rhaiscript/playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Fplayground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273633032,"owners_count":25140772,"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-09-04T02:00:08.968Z","response_time":61,"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":["playground","rhai","rhai-playground","scripting-language","webassembly"],"created_at":"2024-08-09T14:03:43.224Z","updated_at":"2025-09-04T15:46:04.659Z","avatar_url":"https://github.com/rhaiscript.png","language":"Vue","readme":"Rhai Playground\n===\n\nThis is an attempt to make a playground for the [Rhai scripting language][rhai]\nusing WebAssembly.\n\nThe `master` branch is automatically built and deployed [here][playground-dev].\nA known-good build is published on [https://rhaiscript.github.io/playground/stable/][playground-stable].\n\n[rhai]: https://github.com/rhaiscript/rhai\n[playground-stable]: https://rhaiscript.github.io/playground/stable/\n[playground-dev]: https://rhaiscript.github.io/playground/dev/\n\n\nEmbedding the Rhai Playground (work in progress)\n---\n\nIt is still a work-in-progress, but it is possible to embed the playground for\nuse on another web page.\n\n[View demo on CodePen](https://codepen.io/alvinhochun/pen/LYGQEaW)\n\n```html\n\u003cstyle\u003e\niframe.rhaiPlayground {\n    width: 100%;\n    height: 400px;\n    border: 0;\n}\n\u003c/style\u003e\n\n\u003cpre\u003e\u003ccode class=\"language-rhai\"\u003efn hello_rhai(msg) {\n    print(\"Hello world! \" + msg);\n}\nhello_rhai(\"Embed the Rhai Playground to run Rhai code!\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cscript\u003e\nconst ORIGIN = \"https://rhaiscript.github.io\";\nconst PATH = \"/playground/stable/\";\nlet nextPlaygroundIdx = 0;\nfunction loadPlayground(el) {\n    const id = \"\" + nextPlaygroundIdx++;\n    const iframe = document.createElement(\"iframe\");\n    iframe.style = el.style;\n    iframe.className = el.className;\n    iframe.classList.add(\"rhaiPlayground\");\n    iframe.src = ORIGIN + PATH + \"#embed-\" + id;\n    el.replaceWith(iframe);\n    const code = el.innerText;\n    const onMessage = ev =\u003e {\n        if (\n            ev.data.from === \"rhai-playground\" \u0026\u0026\n            ev.data.req === \"embed-loaded\" \u0026\u0026\n            ev.data.id === id\n        ) {\n            iframe.contentWindow.postMessage(\n                {\n                    to: \"rhai-playground\",\n                    req: \"embed-init\",\n                    code,\n                },\n                ORIGIN,\n            );\n            // window.removeEventListener(\"message\", onMessage);\n        }\n    }\n    window.addEventListener(\"message\", onMessage);\n}\n\ndocument.querySelectorAll(\"code.language-rhai\").forEach(el =\u003e {\n    loadPlayground(el);\n});\n\u003c/script\u003e\n```\n\n\n## How to install\n\n```sh\nnpm install\n```\n\n## How to run in debug mode\n\n```sh\n# Builds the project and opens it in a new browser tab. Auto-reloads when the project changes.\nnpm start\n```\n\n## How to build in release mode\n\n```sh\n# Use the Open SSL legacy provider if using Node 17 and above.\n#export NODE_OPTIONS=--openssl-legacy-provider\n\n# Builds the project and places it into the `dist` folder.\nnpm run build\n```\n\n## How to run unit tests\n\n```sh\n# Runs tests in Firefox\nnpm test -- --firefox\n\n# Runs tests in Chrome\nnpm test -- --chrome\n\n# Runs tests in Safari\nnpm test -- --safari\n```\n\n## What does each file do?\n\n* `Cargo.toml` contains the standard Rust metadata. You put your Rust dependencies in here. You must change this file with your details (name, description, version, authors, categories)\n\n* `package.json` contains the standard npm metadata. You put your JavaScript dependencies in here. You must change this file with your details (author, name, version)\n\n* `webpack.config.js` contains the Webpack configuration. You shouldn't need to change this, unless you have very special needs.\n\n* The `js` folder contains your JavaScript code (`index.js` is used to hook everything into Webpack, you don't need to change it).\n\n* The `src` folder contains your Rust code.\n\n* The `static` folder contains any files that you want copied as-is into the final build. It contains an `index.html` file which loads the `index.js` file.\n\n* The `tests` folder contains your Rust unit tests.\n","funding_links":[],"categories":["Vue"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaiscript%2Fplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaiscript%2Fplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaiscript%2Fplayground/lists"}