npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ekit-minify

v0.2.1

Published

Minifier of js, css, html and img (extended from orginial minify package. Checkout at: https://npmjs.org/package/minify)

Downloads

14

Readme

Minify v0.2.1 NPM version Dependency Status Build Status

Flattr

Minify - a minifier of js, css, html and img files, used in Cloud Commander project.

Install

You can install minify just like that:

npm i minify

or

git clone git://github.com/coderaiser/minify

Command Line

For use in command line just write something like:

minify <input-file> <output-file>

or just

minify <input-file>>

to see output in screen.

API

Minify module contains some api for interacting from another js files.

To use Minify functions it sould be connected first. It's doing like always.

minify = require('minify');

All of minification functions save files in ./min directory with extension .min (*.min.js, *.min.css, *.min.html). If directory could be created minify.MinFolder would countain stirng 'min/', in any other case - '/'.

optimize(pFiles_a) - function which minificate js, html and css-files.

  • pFiles_a - varible, wich contain array of file names or string, if name single.
  • pOptions(optional) - object contain main options.

Examples:

minify.optimize('client.js');
minify.optimize('client.js', {
    callback: func(pMinData){}
});

if a couple files:

minify.optimize(['client.js',
    'style.css']);

if post processing needed

minify.optimize({
    'client.js' : function(pFinalCode){}
});

if post image converting needed (works with css only)

minify.optimize([{'style.css': {img: true, merge: true} },
    'index.html']);

if only need the name of minified file (from min directory)

minify.optimize('client.js', {
    returnName  : true
    callback    : function(pParams){
        var lName = pParams && pParams.name;
        console.log(lName)
    }
});

MinFolder - varible thet contains folder name, where minimized files stored. (could not be changed for now).

Additional modules:

  • [UglifyJS] (https://github.com/mishoo/UglifyJS)
  • [clean-css] (https://github.com/GoalSmashers/clean-css)
  • [html-minifier] (https://github.com/kangax/html-minifier)
  • [css-b64-images] (https://github.com/Filirom1/css-base64-images)

Install addtitional modules:

npm i uglify-js clean-css html-minifier css-b64-images

Contributing

If you would like to contribute - send pull request to dev branch. Getting dev version of Minify:

git clone git://github.com/coderaiser/minify.git
git checkout dev

Version history