Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 621 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 621 Bytes

lune-minify-js

Simple minify-js wrapper for lune runtime, with ffi edge feature.

Example usage

Run cargo build --profile=release first to get shared object.

local minify_js = require("./minify-js")
    .new("./minify-js/target/release/liblune_minify_js.so")

-- Throw error if syntax error in code
local result = minify_js:minify([[
    // Javascript code here
    return function (numberA, numberB) {
        return numberA + numberB
    }
]], minify_js.TopLevelMode.Global)

print(result) -- return ((a,b)=>a+ b)

minify_js:drop() -- Drop library datas