在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mathiasbynens/luamin开源软件地址(OpenSource Url):https://github.com/mathiasbynens/luamin开源编程语言(OpenSource Language):JavaScript 60.7%开源软件介绍(OpenSource Introduction):luamin, a Lua minifier written in JavaScriptluamin uses the excellent luaparse library to parse Lua code into an Abstract Syntax Tree. Based on that AST, luamin then generates a (hopefully) more compact yet semantically equivalent Lua program. Here’s an online demo. luamin was inspired by the LuaMinify and Esmangle projects. Feel free to fork if you see possible improvements! Installation and usageVia npm: npm install luamin Via Bower: bower install luamin Via Component: component install mathiasbynens/luamin In a browser: <script src="luamin.js"></script> In Narwhal, Node.js, and RingoJS: var luamin = require('luamin'); In Rhino: load('luamin.js'); Using an AMD loader like RequireJS: require(
{
'paths': {
'luamin': 'path/to/luamin'
}
},
['luamin'],
function(luamin) {
console.log(luamin);
}
); Usage example: var luaCode = 'a = ((1 + 2) - 3) * (4 / (5 ^ 6)) -- foo';
luamin.minify(luaCode); // 'a=(1+2-3)*4/5^6'
// `minify` also accepts luaparse-compatible ASTs as its argument:
var ast = luaparse.parse(luaCode, { 'scope': true });
luamin.minify(ast); // 'a=(1+2-3)*4/5^6'
Using the |
Mathias Bynens |
luamin is available under the MIT license.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论