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

the-minifier

v1.2.2

Published

A light library to minify css easily

Downloads

7

Readme

The Minifier

Maintainability Test Coverage example workflow

The minifier is the new fast, light and easy-to-use minifier to optimize your css files (HTML and Javascript WIP) before deploying your web applications in production

Install

npm install the-minifier

Verify package installation

the-minifier --version

If your command prompt prints the following line the package is correctly installed

the-minifier 1.2.0

Usage with cli

to see the available order list

the-minifier

you can get all the commands available via the minifier

🗜️  Minify html, css and javascript

  A light library to minify javascript, css and html easily 

⚙️  Options ⚙️

  -h, --help       🆘 Print this usage guide                                     
  -a, --all        📝 Minify all project                                         
  -c, --css        🖌️ Minify all project css                                    
  -w, --html       🌐 Minify all project html                                    
  -j, --js         🚂 Minify all project javascript                              
  -t, --ts         🚆 Minify all project typescript                              
  -n, --no-min     ❌ Does not generate a .min file but overwrites existing files 
  -v, --version    🔍 View current install version

Other languages such as html and javascript will be available in future iterations

How it works ?

to minfy css you can use the following command

the-minifier --css

imagine your css file is in a style folder like this: ./style/index.css

after using the command mentioned above you will see in this style folder a new file in this format: ./style/index.min.css

the system is the same with html or javascript

if you want to minify the html of your project type the following command

the-minifier --html

you will see *.min.html files appear

same for javascript

the-minifier --js

you will see *.min.js files appear

the application now supports typescript in addition to javascript

the-minifier --ts

If you don't want to create a .min file you can use the --no-min option in your command.

the-minifier --js --no-min

⚠️ Warning this option will overwrite the existing file to recreate it with the minifier content

Usage library

You can use our minification methods manually by importing them directly into your project.

// example
const { cssMinifier, cssFormatter } = require('the-minifier');

Minifiy all files provided as arguments

cssMinifier(cssFilesPath, nomin);

| arguments | description | type | |-:|--|:-| |cssFilesPath|Array containing the path of the files to minify|Array| |nomin|If this argument is true it will generate a .min file|Boolean|

Minifiy all files provided as arguments

htmlMinifier(htmlFilesPath, nomin);

| arguments | description | type | |-:|--|:-| |htmlFilesPath|Array containing the path of the files to minify|Array| |nomin|If this argument is true it will generate a .min file|Boolean|

Minifiy all files provided as arguments

jsMinifier(jsFilesPath, nomin);

| arguments | description | type | |-:|--|:-| |jsFilesPath|Array containing the path of the files to minify|Array| |nomin|If this argument is true it will generate a .min file|Boolean|

Minifiy all files provided as arguments

tsMinifier(tsFilesPath, nomin);

| arguments | description | type | |-:|--|:-| |tsFilesPath|Array containing the path of the files to minify|Array| |nomin|If this argument is true it will generate a .min file|Boolean|

Return string content minify

htmlFormatter(htmlContent);

| arguments | description | type | |-:|--|:-| |htmlContent|Content to minify|string|

Return string content minify

cssFormatter(cssContent);

| arguments | description | type | |-:|--|:-| |cssContent|Content to minify|string|

Return string content minify

⚠️ The jsFormatter method also supports typescript

jsFormatter(jsContent);

| arguments | description | type | |-:|--|:-| |jsContent|Content to minify|string|

Bugs

If you find a bug please report it on github by creating a new issues.

Contributing

If you wish to contribute to the project refer to CONTRIBUTING.md