Here is some code to see how it's like:
I took code and ideas from :
The default extension is ".ljs".
On folder lua2ljs there is a program to convert lua sources to ljs.
lua2ljs afile.lua > afile.ljs
This is based on Lua 5.3.5, released on 26 Jun 2018.
For installation instructions, license details, and further information about Lua, see doc/readme.html.
There is also the following port from lua to ljs:
ljsjit at https://github.com/mingodad/ljsjit
ljs-5.1 at https://github.com/mingodad/ljs-5.1
ZeroBraneStudio port at https://github.com/mingodad/ZeroBraneStudioLJS
raptorjit-ljs at https://github.com/mingodad/raptorjit-ljs
snabb-ljs at https://github.com/mingodad/snabb-ljs
premake5-ljs at https://github.com/mingodad/premake-core/tree/ljs
CorsixTH-0.62-ljs at https://github.com/mingodad/CorsixTH-ljs
The tool lua2ljs does the convertion on almost all Lua code, except dynamic Lua code inside strings, C/C++ code, auxiliar scripts and makefiles, LJS also flag as warning/error duplicate variable declarations and a revision is needed mainly using "ljsc -p -l ljsSource.ljs > /dev/null" to only compile and emit the warnings/error to stderr, then several text scans to search and replace "nil", ".lua" and Lua code inside strings, ...
Finally run the tests if available to check that it's working properly (at least with the tests).