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 files on a fly to reduce requests count.
Install
npm i join-io --save
How it works?
join-io it's middleware that works with streams: open files and pipe them to response one-by-one,
when everything is done, stream is closing. join-io based on readPipe function of files-io.
jsDelivr works in similar way: load Multiple files with a single HTTP request.
How 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,
minify: false /* default */
}));
app.use(express.static(__dirname));
server.listen(port, ip);License
MIT