Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-compile-middleware

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-compile-middleware - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

19

lib/index.js

@@ -51,14 +51,14 @@ 'use strict';

if (error) {
return res.end(formatError(error));
setError(res, error);
return res.end();
}
var out = void 0;
try {
out = compiler.compile(data, srcPath);
res.setHeader('Content-Type', _mime2.default.lookup(pathname));
res.write(compiler.compile(data, srcPath));
} catch (error) {
out = formatError(error);
setError(res, error);
}
res.end(out);
res.end();
});

@@ -88,4 +88,9 @@ }, next);

function formatError(error) {
return error.stack;
function setError(res, error) {
res.setHeader('Content-Type', 'text/html');
res.write(wrapHTMLContent('<output><pre>' + error.stack + '</pre></output>'));
}
function wrapHTMLContent(content) {
return '<!DOCTYPE html><html><body>' + content + '</body><html>';
}
{
"name": "bs-compile-middleware",
"version": "0.1.2",
"version": "0.1.3",
"author": "katashin",

@@ -5,0 +5,0 @@ "description": "Compilation middleware for Browsersync",

@@ -24,2 +24,3 @@ # bs-compile-middleware

browserSync({
server: true,
middleware: compileMiddleware({

@@ -26,0 +27,0 @@ srcDir: 'path/to/src',

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