Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

connect-minify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-minify

middleware to demand combine and minify resources

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

Usage

var minify = require('connect-minify');

app.use(minify({
  // assets map - maps served file identifier to a list of resources
  assets: {
    "/js/main.min.js": [
      '/js/lib/jquery.js',
      '/js/magick.js',
      '/js/laughter.js'
    ],
    "/css/home.min.css": [
      '/css/reset.css',
      '/css/home.css'
    ],
    "/css/dashboard.min.css": [
      '/css/reset.css',
      '/css/common.css'
      '/css/dashboard.css'
    ] },
  // root - where resources can be found
  root: path.join(__dirname, '..', 'static),
  // default is to minify files
  disable_minification: false
});

Then later to generate a URL:

app.use(function(req, res, next) {
  req.minifiedURL('/css/home.min.css');
});

Or to do the same in a template:

<head>
  <script src="<%- minifiedURL('/js/main.min.js') %>"></script>
</head>

FAQs

Package last updated on 06 Jun 2013

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc