mini-compress

0.0.4 • Public • Published

mini-compress

mini-route file compression handler.

Example:

var http = require('http');
var MiniRoute = require('mini-route');
var miniCompress = require('mini-compress');
 
var server = http.createServer();
var router = new MiniRoute(server);
 
router.get('/', function(req, res) {
  miniCompress(req, 'some data to compress', function(err, compressed) {
    res.end(compressed);
  });
});
 
server.listen(8080);

This can also be used with Express:

var miniFile = require('mini-file');
var app = require('express')();
 
app.get('/', function(req, res) {
  miniCompress(req, 'some data to compress', function(err, compressed) {
    res.end(compressed);
  });
});
 
app.listen(8080);

/mini-compress/

    Package Sidebar

    Install

    npm i mini-compress

    Weekly Downloads

    1

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • facekapow