{"id":16269535,"url":"https://github.com/av/redscript","last_synced_at":"2025-08-10T06:06:15.026Z","repository":{"id":34902915,"uuid":"38938483","full_name":"av/redscript","owner":"av","description":"RedScript subset for JavaScript language","archived":false,"fork":false,"pushed_at":"2015-10-04T10:59:29.000Z","size":176,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-06T23:51:41.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/av.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}},"created_at":"2015-07-11T19:52:49.000Z","updated_at":"2024-08-08T02:57:02.000Z","dependencies_parsed_at":"2022-09-01T06:02:04.472Z","dependency_job_id":null,"html_url":"https://github.com/av/redscript","commit_stats":null,"previous_names":["iamfrontender/redscript"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/av/redscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fredscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fredscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fredscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fredscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/av","download_url":"https://codeload.github.com/av/redscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fredscript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269683183,"owners_count":24458628,"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-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2024-10-10T18:08:34.053Z","updated_at":"2025-08-10T06:06:14.992Z","avatar_url":"https://github.com/av.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Red Script](http://img42.com/CvCSa+ \"RedScript\")\n\nRedScript is language (actually don't) that transpiles to JavaScript.\nThis code is created with the help of [your-script](https://github.com/iamfrontender/your-script) module.\n\nThe source files in RedScript have `.rs` extension.\n\n## Disclaimer\nThis module is created just for enormous incredible fun, nothing more. I can't even imagine someone really writing programms on this subset.\n\n## Usage\nThis module is distributed via npm, it requires global installation, run `npm i -g rscript` just where you want this code.\nRedScript provides minimal console tool to translate source files to JavaScript and vice versa.\nAfter installed globally it availble in your wd as `redscript`\n\nRun `redscript yourFile.js` or `redscript yourFile.rs` to translate it to opposite subset.\n\n## Example\n\nLets imagine, your JS file, `programm.js` contains following code:\n```javascript\n    function функ(икс, игрек, зет) {                         \n    var и = 0;                              \n    var икс = {0: \"ноль\", 1: \"один\"};          \n    var функ = function () {                  \n    }                                          \n    if (!и \u003e 10) {                           \n        for (var j = 0; j \u003c 10; j++) {      \n            switch (j) {                \n                case 0:                   \n                    значение = \"zero\";            \n                    break;                      \n                case 1:                   \n                    значение = \"one\";             \n                    break;                      \n            }                                  \n            var с = джей \u003e 5 ? \"ГТ 5\" : \"ЛЕ 5\";\n        }                                      \n    } else {                                  \n        var джей = 0;                          \n        try {                             \n            while (джей \u003c 10) {                    \n                if (и == джей || джей \u003e 5) {       \n                    a[джей] = и + джей * 12;         \n                }                              \n                и = (джей \u003c\u003c 2) \u0026 4;              \n                джей++;                           \n            }                                  \n            do {                            \n                джей--;                           \n            } while (джей \u003e 0)                     \n        } catch (e) {                           \n            alert(\"Крах: \" + e.message);    \n        } finally {                              \n            обнулить(a, и);                       \n        }                                      \n    }                                          \n}                                   \n```\n\nAfter launching `redscript programm.js` in directory with this file, parser will create transpiled source file, `programm.rs`, translated in RedScript and look as following:\n\n```javascript\nфункция функ(икс, игрек, зет) {                         \n    примем и = 0;                              \n    примем икс = {0: \"ноль\", 1: \"один\"};          \n    примем функ = функция () {                  \n    }                                          \n    если (!и \u003e 10) {                           \n        для (примем j = 0; j \u003c 10; j++) {      \n            переключатель (j) {                \n                положение 0:                   \n                    значение = \"zero\";            \n                    стоп;                      \n                положение 1:                   \n                    значение = \"one\";             \n                    стоп;                      \n            }                                  \n            примем с = джей \u003e 5 ? \"ГТ 5\" : \"ЛЕ 5\";\n        }                                      \n    } иначе {                                  \n        примем джей = 0;                          \n        попробуй {                             \n            пока (джей \u003c 10) {                    \n                если (и == джей || джей \u003e 5) {       \n                    a[джей] = и + джей * 12;         \n                }                              \n                и = (джей \u003c\u003c 2) \u0026 4;              \n                джей++;                           \n            }                                  \n            делай {                            \n                джей--;                           \n            } пока (джей \u003e 0)                     \n        } лови (e) {                           \n            alert(\"Крах: \" + e.message);    \n        } затем {                              \n            обнулить(a, и);                       \n        }                                      \n    }                                          \n}                                   \n```\n\n## What it is and what isn't\n\nSince RedScript is based on your-scipt, this subset is limited by modifying the language keywords. So, any global object properties, like `document.body` or `HTMLElement.prototype.nextElementSibling` are untouched, though it's definetely possible :)\n\n## Under the hood\n\n[your-script](https://github.com/iamfrontender/your-script)\n[esprima-custom-keywords](https://github.com/iamfrontender/esprima-custom-keywords)\n[keywords-provider](https://github.com/iamfrontender/keywords-provider)\n\nCheers!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav%2Fredscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fav%2Fredscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav%2Fredscript/lists"}