~ryanford/jsmin-lua

Lua port of Crockford's JSMin.c lib
~ryanford/jsmin-lua

New ticket tracker added

3 years ago
~ryanford/jsmin-lua

New git repository added

3 years ago

#jsmin.lua

Lua port of Crockford's JSMin.c

#Install:
luarocks install jsmin
#Usage:

From CLI:

$ cat <<EOF > input.js
(function() {
   console.log("Hello, World!");
   // removes comments
   return 0;
  })()
EOF
$ jsmin <input.js >output.js
$
$ cat output.js
(function(){console.log("Hello, World!");return 0;})()

From Lua:

local jsmin = require("jsmin")
local js_str = [[
(function() {
   console.log("Hello, World!");
   // removes comments
   return 0;
})()]]

print(jsmin(js_str))
-- (function(){console.log("Hello, World!");return 0;})()

Report issues on the issue tracker