Giter VIP home page Giter VIP logo

html-minify's Introduction

Description

Build Status Dependency Status

This is a node.js module that minimize HTML files with any CSS & JS. the css minify use cssmin,the html minify use the html-minifier

Installation

You can either download the plugin and unzip it into to your project folder or you can use npm to install the cssmin package.

npm -g i html-minify
    %> htmlminify one.html
    %> htmlminify -o one-min-utf8.html one-utf8.html //default charset is utf-8
    %> htmlminify -o one-min-gbk.html one-gbk.html -c gbk

how to use?see this:

Usage

The module exports the html-minify function, so you can use it with :

var htmlminify = require('html-minify');

The function htmlminify takes two arguments :

  • input : the html content you want to minimize.
  • linebreakpos : the number of characters before the end of the line. If empty, the output will have only one line.

Example :

var puts = require('util').puts,
fs = require('fs'),
var htmlminify = require('./html-minify');
var text = fs.readFileSync("/Any/Random/HTML.html", encoding='utf8');
var min = htmlminify(text);
puts(min);

history

  • 2013-07-08 minify js and css
  • 2013-07-03 change iconv to iconv-lite
  • 2013-06-26 fix utf-8 charset bug
  • 2013-05-31 cli support charset
  • 2013-05-30 first update

html-minify's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

html-minify's Issues

JSminify

JS minify has some problem.

we need to add remove comments option

to ensure your scripts work after minification - terminate JS statements with a semicolon, and use /* */ syntax for comments.

JavaScript logical operators

If I use locical operators to compare two numbers the parser fails because of less than (<) operator.
Greater than works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.