Socket
Socket
Sign inDemoInstall

live-server

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

live-server - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

test/data/fragment.html

26

index.js
#!/usr/bin/env node
var fs = require('fs'),
connect = require('connect'),
serveIndex = require('serve-index'),
logger = require('morgan'),
WebSocket = require('faye-websocket'),

@@ -18,3 +20,4 @@ path = require('path'),

server: null,
watchers: []
watchers: [],
logLevel: 2
};

@@ -58,3 +61,3 @@

}
if (injectTag === null) {
if (injectTag === null && LiveServer.logLevel >= 2) {
console.warn("Failed to inject refresh script!".yellow,

@@ -127,3 +130,3 @@ "Couldn't find any of the tags ", injectCandidates, "from", filepath);

var watchPaths = options.watch || [root];
var logLevel = options.logLevel === undefined ? 2 : options.logLevel;
LiveServer.logLevel = options.logLevel === undefined ? 2 : options.logLevel;
var openPath = (options.open === undefined || options.open === true) ?

@@ -141,5 +144,6 @@ "" : ((options.open === null || options.open === false) ? null : options.open);

var mountPath = path.resolve(process.cwd(), mountRule[1]);
watchPaths.push(mountPath);
if (!options.watch) // Auto add mount paths to wathing but only if exclusive path option is not given
watchPaths.push(mountPath);
app.use(mountRule[0], staticServer(mountPath));
if (logLevel >= 1)
if (LiveServer.logLevel >= 1)
console.log('Mapping %s to "%s"', mountRule[0], mountPath);

@@ -149,5 +153,5 @@ });

.use(entryPoint(staticServerHandler, file))
.use(connect.directory(root, { icons: true }));
if (logLevel >= 2)
app.use(connect.logger('dev'));
.use(serveIndex(root, { icons: true }));
if (LiveServer.logLevel >= 2)
app.use(logger('dev'));
var server = http.createServer(app);

@@ -181,3 +185,3 @@

// Output
if (logLevel >= 1) {
if (LiveServer.logLevel >= 1) {
if (serveURL === openURL)

@@ -245,7 +249,7 @@ console.log(("Serving \"%s\" at %s").green, root, serveURL);

ws.send('refreshcss');
if (logLevel >= 1)
if (LiveServer.logLevel >= 1)
console.log("CSS change detected".magenta, filePath);
} else {
ws.send('reload');
if (logLevel >= 1)
if (LiveServer.logLevel >= 1)
console.log("File change detected".cyan, filePath);

@@ -252,0 +256,0 @@ }

{
"name": "live-server",
"version": "0.9.1",
"version": "0.9.2",
"description": "simple development http server with live reload capability",

@@ -16,6 +16,8 @@ "keywords": [

"colors": "latest",
"connect": "2.x.x",
"connect": "3.4.x",
"serve-index": "^1.7.2",
"morgan": "^1.6.1",
"event-stream": "latest",
"faye-websocket": "0.9.x",
"object-assign": "^2.0.0",
"faye-websocket": "0.10.x",
"object-assign": "latest",
"opn": "latest",

@@ -27,3 +29,3 @@ "send": "latest",

"mocha": "^2.3.3",
"supertest": "1.0.1"
"supertest": "^1.0.1"
},

@@ -42,3 +44,3 @@ "scripts": {

"engines": {
"node": ">=0.8.0"
"node": ">=0.10.0"
},

@@ -45,0 +47,0 @@ "preferGlobal": true,

@@ -78,3 +78,3 @@ [![view on npm](http://img.shields.io/npm/v/live-server.svg)](https://www.npmjs.org/package/live-server)

file: "index.html", // When set, serve this file for every 404 (useful for single-page applications)
wait: 1000 // Waits for all changes, before reloading. Defaults to 0 sec.
wait: 1000, // Waits for all changes, before reloading. Defaults to 0 sec.
mount: [['/components', './node_modules']] // Mount a directory to a route.

@@ -107,2 +107,6 @@ };

* v0.9.2
- Updated most dependencies to latest versions
- `--quiet` now silences warning about injection failure
- Giving explicit `--watch` paths now disables adding mounted paths to watching
* v0.9.1

@@ -109,0 +113,0 @@ - `--ignorePattern=RGXP` exclude files from watching by regexp (@psi-4ward)

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