0.33.0 • Published 8 months ago

@xiangnanscu/lua2js v0.33.0

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

@xiangnanscu/lua2js

@xiangnanscu/lua2js transform lua to js literally.

Install

npm install -g @xiangnanscu/lua2js

Usage

command

Concat one or more js files and transform them to one lua string:

lua2js [options] file1, file2, ...

where options are:

const defaultOptions = {
  printToConsoleLog: true,
  tryUseOfLoop: true,
  indexMinusOne: false,
  returnNilToThrow: false,
  errorToThrow: true,
  tostring: true,
  dict: false,
  list: false,
  unpack: true,
  tonumber: true,
  class: false,
  selfToThis: true,
  clsToThis: true,
  typeToTypeof: true,
  stringFormat: false,
  tableConcat: false,
  tableInsert: false,
  camelStyle: false,
};

examples

Basic:

lua2js foo.lua > foo.js

To disable a feature --no-[option]:

lua2js --no-camelStyle foo.lua

To enable a feature --[option]:

lua2js --camelStyle foo.lua

api

import { lua2js } from "lua2js";

const jscode = lua2js(`local snake_var = 1`, { camelStyle: true });
// let snakeVar = 1;

see also

@xiangnanscu/js2lua transform js to lua

0.33.0

8 months ago

0.32.0

11 months ago

0.31.0

11 months ago

0.30.0

11 months ago

0.29.0

12 months ago

0.28.0

12 months ago

0.27.0

12 months ago

0.26.0

1 year ago

0.25.0

1 year ago

0.24.0

1 year ago

0.23.0

1 year ago

0.22.0

1 year ago

0.15.0

1 year ago

0.16.0

1 year ago

0.11.0

1 year ago

0.9.0

2 years ago

0.8.0

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago