{"id":17482796,"url":"https://github.com/creationix/brozula","last_synced_at":"2025-10-23T15:01:39.153Z","repository":{"id":5734086,"uuid":"6946138","full_name":"creationix/brozula","owner":"creationix","description":"VM that runs in the browser and interprets luajit bytecode.","archived":false,"fork":false,"pushed_at":"2018-08-28T03:30:51.000Z","size":123,"stargazers_count":170,"open_issues_count":4,"forks_count":13,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-08-02T00:41:32.662Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creationix.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":"2012-11-30T21:38:01.000Z","updated_at":"2024-08-08T15:42:11.000Z","dependencies_parsed_at":"2022-08-24T21:41:12.243Z","dependency_job_id":null,"html_url":"https://github.com/creationix/brozula","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/creationix/brozula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fbrozula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fbrozula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fbrozula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fbrozula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/brozula/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fbrozula/sbom","scorecard":{"id":308068,"data":{"date":"2025-08-11","repo":{"name":"github.com/creationix/brozula","commit":"d3a0b315d23e17fd6d1c71c3e87ce3601949a8fc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 4/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T22:35:11.584Z","repository_id":5734086,"created_at":"2025-08-17T22:35:11.584Z","updated_at":"2025-08-17T22:35:11.584Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271415025,"owners_count":24755628,"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-20T02:00:09.606Z","response_time":69,"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-18T23:44:46.394Z","updated_at":"2025-10-23T15:01:39.082Z","avatar_url":"https://github.com/creationix.png","language":"JavaScript","funding_links":[],"categories":["Resources"],"sub_categories":["Compiles to JS, asm.js or WebAssembly for Browser"],"readme":"# Brozula\n\nBrozula is a luajit bytecode compiler that generates ES5 JavaScript.  This means\nyou can write webapps using lua code, compile it to bytecode, and run the lua in\neither node.js or a browser environment.\n\n# Status\n\nThis project is not done.  I just started it while I was at\nLua Workshop 2012 in DC.  Currently it can parse nearly all luajit bytecode and\nexecute a subset of the lua language.  This is not a lua -\u003e bytecode compiler.\nYou'll need the luajit binary to do that part of the conversion.  [Performance][]\nseems pretty good so far in initial benchmarks.  Only time will tell how this scales.\n\n# Installing\n\nBrozula can be used as either a nodejs module or a browser library.  To see how\nto use in the browser, look at [index.html][]. To use in nodejs, use the\n`brozula` module in npm.\n\n## CLI\n\nThere is a command-line-interface to brozula called `brozula` that can be\ninstalled by installing the npm module globally.\n\n```sh\nnpm install -g brozula\n```\n\nI'll let the tool speak for itself since it's self documented.\n\nThere is also a [recording][] of using it in action.\n\n```\n$ brozula\nUsage: brozula [OPTION...] program.lua[x]\nBrozula compiles lua files to bytecode and then executes them using a JS VM\nThe lua -\u003e luax (luajit bytecode) step is done by using luajit\n\nExamples:\n  brozula myprogram.lua\n  brozula --print myprogram.lua\n  brozula -pb myprogram.luax\n\n Main operation mode:\n\n  -x, --execute          Execute the generated javascript\n                         (This is the default behavior)\n  -p, --print            Print the generated javascript\n  --serve port           Serve the current folder over HTTP auto-compiling\n                         any lua scripts requested\n\n Operation modifiers:\n\n  -u, --uglify           Compress the generated javascript using uglify-js\n  -b, --beautify         Beautify the generated javascript using uglify-js\n  -l, --lines            Show line numbers when printing\n```\n\n## End-to-end lua webapps.\n\nOne use of this is to write end-to-end lua webapps using something like [luvit][]\nor [moonslice][] for the server-side half, and writing your browser-side scripts\nin lua that's then executed *in* the browser using Brozula.\n\nI plan on adding child process support to [luv][] so that a [moonslice][] framework\ncan be built for doing everything from a single place.\n\n## Obfuscated JavaScript Apps.\n\nThe question comes up all the time.  How can I ship a JavaScript app without\nsharing my code with the world.  JavaScript minimizers do a pretty good job at\nthis, but we can do better.\n\nIf you want your JavaScript code protected from prying eyes, write it in Lua!\nThen you only have to share the binary bytecode publicly which is considerably\nharder to make sense of and near impossible to trace back to the original code.\n\nFor example, consider the following lua module that calculates factorials:\n\n```lua\nlocal function fact (n)\n  if n == 0 then\n    return 1\n  else\n    return n * fact(n-1)\n  end\nend\nreturn fact\n```\n\nThe only code you have to store in your node-webkit or web app would be brozula\nand the following bytecode:\n\n```hd\n00000000  1b 4c 4a 01 02 37 00 01  03 01 00 02 0b 09 00 00  |.LJ..7..........|\n00000010  00 54 01 03 80 27 01 01  00 48 01 02 00 54 01 05  |.T...'...H...T..|\n00000020  80 2b 01 00 00 15 02 01  00 3e 01 02 02 20 01 01  |.+.......\u003e... ..|\n00000030  00 48 01 02 00 47 00 01  00 00 c0 00 02 14 03 00  |.H...G..........|\n00000040  01 00 01 00 03 31 00 00  00 30 00 00 80 48 00 02  |.....1...0...H..|\n00000050  00 00 00                                          |...|\n00000053\n```\n\nNotice that even the `fact` variable name was optimized out by luajit's compiler.\nYour original lua code never has to be released to the public since the JavaScript\nengines can't make any sense out of lua code anyway.\n\nBrozula converts this bytecode to JavaScript something like:\n\n```js\n(function(){function r(r){return null===r?[\"nil\"]:\"object\"==typeof r?[\"table\"]:[typeof r]}\nfunction t(r){return Array.isArray(r)?r:void 0===r?[]:[r]}function e(r,t){\nreturn Object.defineProperty(r,\"__metatable\",{value:t}),[r]}function n(){\nconsole.log(Array.prototype.join.call(arguments,\"  \"))}function o(r,t){\nreturn r?arguments:(a(t),void 0)}function a(r){throw r}function u(r){for(var e,n,o,a=\"0\";;)\nswitch(a){case\"0\":if(0!==r){a=\"5\";break}return n=1,[n];case\"5\":return n=this.__proto__.closure[0],\no=r-1,e=t(n(o)),n=e[0],e=void 0,n=r*n,[n];case\"a\":return[]}}function c(){for(var r,t=\"0\";;)\nswitch(t){case\"0\":r=u.bind(Object.create(this)),this.closure=[r],t=\"2\";break;case\"2\":return[r]}}\nvar i={type:r,setmetatable:e,print:n,assert:o,error:a};return c.apply(i,arguments)})();\n```\n\n## License\n\nBrozula is licensed under the MIT license.\n\n[luvit]: http://luvit.io/\n[moonslice]: https://github.com/creationix/moonslice-luv\n[luv]: https://github.com/creationix/luv\n[index.html]: https://github.com/creationix/brozula/blob/master/widgets/index.html\n[recording]: http://codestre.am/a0b85e026d7f63958cb5adf7c\n[Performance]: http://jsperf.com/efficient-goto\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fbrozula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fbrozula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fbrozula/lists"}