Socket
Socket
Sign inDemoInstall

asset-pipe-dev-middleware

Package Overview
Dependencies
294
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9

27

lib/middleware.js

@@ -24,3 +24,9 @@ 'use strict';

this.writer.on('update', () => {
this.writer.bundle().pipe(devnull());
const bundler = this.writer.bundle();
bundler.on('error', (e) => {
this.emit('error', e);
});
bundler.pipe(devnull());
});

@@ -53,6 +59,19 @@

js () {
const self = this;
return (req, res) => {
return (req, res, next) => {
res.writeHead(200, { 'Content-Type': 'application/javascript' });
self.writer.bundle().pipe(res);
const bundler = this.writer.bundle();
bundler.on('error', cleanup);
const writeStream = bundler
.pipe(res)
.on('error', cleanup);
function cleanup (e) {
res.write(`console.error(${JSON.stringify(e.stack)})`);
bundler.pause();
bundler.unpipe(writeStream);
writeStream.end();
next(e);
}
};

@@ -59,0 +78,0 @@ }

2

package.json
{
"name": "asset-pipe-dev-middleware",
"version": "1.0.0-alpha.8",
"version": "1.0.0-alpha.9",
"author": {

@@ -5,0 +5,0 @@ "name": "Trygve Lie",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc