jlua

0.0.6 • Public • Published

jlua

Yet another Lua implementation in pure JavaScript. It encapsulates:

  • Frontend infrastructure like Lexer and Parser to generate AST
  • Some subclasses of AstVisitors like YamlVisitor and Codegen generate YAML reflects the AST and bytecode for LuaVM, respectively
  • Particularly, JsCodegen translates Lua to JavaScript for running Lua on JavaScript runtime directly, more

Here is a demo naturally built with jlua and Vue.js, in other words we can use Lua within Single File Component, for example:

<template>
 <div>hi {{ lang }}</div>
</template>
 
<script lang="lua">
local m = {
 data = function () 
   return {
     lang = "Lua"
   }
 end
}
return m
</script>

here is the source of the demo.

Readme

Keywords

none

Package Sidebar

Install

npm i jlua

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

741 kB

Total Files

52

Last publish

Collaborators

  • hsiaosiyuan0