Quickly JavaScript and CSS minifier using Toptal API.
npm install quick-minifier
const quickminifier = require("quick-minifier");
var code = `
$(function() {
$("#app").html("Hello, World!");
});
`;
quickminifier.js(code).then(minified_code => {
console.log(minified_code);
/*
$(function(){$("#app").html("Hello, World!")});
*/
}).catch(err => {
console.error(err);
});
const quickminifier = require("quick-minifier");
var code = `
body {
text-align: center;
font-family: arial;
font-size: 16px
}
h1 {
color: #2E2EFF;
}
`;
quickminifier.css(code).then(minified_code => {
console.log(minified_code);
/*
body{text-align:center;font-family:arial;font-size:16px}h1{color:#2e2eff}
*/
}).catch(err => {
console.error(err);
});