Socket
Socket
Sign inDemoInstall

abridge

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abridge

Streaming minifier for JS and CSS


Version published
Weekly downloads
82
decreased by-7.87%
Maintainers
1
Weekly downloads
 
Created
Source

Abridge

npm install abridge

Abridge is a streaming compiler for CSS & JavaScript. It is a superset of ycssmin and uglify-js, with a streamable interface on top.

Usage

var abridge = require('abridge');
/* abridge.{Minifier, createStream, minify} */

Piping output

Pipe #minify output to any writable stream.

abridge.minify('path/to/my/file.js').pipe(process.stdout);

You may use either a String or an instance of fs.ReadStream as a first argument.

var inputStream = require('fs').createReadStream('path/to/my/file.css');
abridge.minify(inputStream).pipe(process.stdout);

Using callback

Throw in a callback if you desire.

abridge.minify('file.js', function(err, data) {
});

minify is createStream

abridge.createStream('file.css').pipe(process.stdout);

Minify multiple files at once

abridge.minify(['file1.js', 'file2.js']).pipe(process.stdout);

Serve minified scripts and styles

Abridge can be integrated into a web server for quickly minifying scripts & styles.

var http = require('http');
var server = http.createServer(function(req, res) {
    abridge.createStream(req.url.slice(1)).pipe(res);
});
server.listen(8080);

For a complete file server solution that uses Abridge minification as well as automatic gzipping, see Lactate

##License

MIT

FAQs

Package last updated on 10 Jan 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