JSPM

  • Created
  • Published
  • Downloads 1384
  • Score
    100M100P100Q104322F
  • License MIT

Join files on a fly to reduce requests count

Package Exports

  • join-io

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (join-io) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Join-io

Join stream of many files and pipe it to one response.

Install

npm i join-io --save

Hot to use?

Join-io could be used as express middleware.

Client

<link rel="/join:/css/normilize.css:/css/style.css">
<script src="/join:/lib/client.js:/lib/util.js:/lib/jquery.js"></script>

Server

var join        = require('join-io'),
    http        = require('http'),
    express     = require('express'),
    
    app         = express(),
    server      = http.createServer(app),
    
    port        = 1337,
    ip          = '0.0.0.0';
    
app.use(join({
    dir: __dirname
}));

app.use(express.static(__dirname));

server.listen(port, ip);

License

MIT