New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-compressor

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-compressor

A complete solution to compress static files

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
7
-22.22%
Maintainers
1
Weekly downloads
 
Created
Source

Node Compressor

A complete solution to compress static files with node inspired by django-compressor

Installation

npm install node-compressor -g

How it works?

It's a command line tool that receives as parameter an HTML file and compresses the JavaScript and CSS files called. It also minify the HTML file.

The files that you want to compress must be between <!-- compress js/css --> and <!-- endcompress -->, for example, like this:

After, run this command in your Terminal:

node-compressor YOUR_FILE-1.html YOUR_FILE-2.html

Then, Node Compress will compress these files and deliver them within the directory .compressed

Example

Wrap the assets as you'd like them to be concatenated:

<!-- compress js -->
<script src="foo/bar.js"></script>
<script src="lol/yey.js"></script>
<!-- endcompress -->

<!-- compress js -->
<script src="pow/go.js"></script>
<script src="cca/xyzzy.js"></script>
<!-- endcompress -->

After the compression the result will be like this:

<script src="js/72b302bf297a228a75730123efef7c41.js"></script>
<script src="js/aca25d624cf863f786f67137c62aa11d.js"></script>

Keywords

compress

FAQs

Package last updated on 21 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts