Saturday 13 May 2017

How to use html-minifier npm module?

I want to minify my html files from node.js using this module https://www.npmjs.com/package/html-minifier

I have this code

                // minify the html code
                fse.readFile(filename, function(err, data) {
                    if (err) return console.error(err);
                    var result = minify(data.toString(), {
                        removeAttributeQuotes: false
                    });
                    console.log(result);
                });

However it logs the same code as from the original file. It didn't minify it. Does anyone know what's wrong?

Thanks



via omega

No comments:

Post a Comment