Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

hexo-server-live

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-server-live - npm Package Compare versions

Comparing version
0.2.8
to
0.2.9
+4
-0
CHANGELOG.md

@@ -0,1 +1,5 @@

## v0.2.9 (2024-01-17)
- Improvement: handle theme config correctly.
## v0.2.8 (2024-01-16)

@@ -2,0 +6,0 @@

+26
-19

@@ -39,24 +39,8 @@ hexo.extend.filter.register("server_middleware", async (app) => {

const ext = extname(event.path);
const output = hexo.extend.renderer.getOutput(event.path);
let path = "/" + event.path.replace(/^source\//, "");
let type = "other";
const data = transformProcessedInfo(event.path);
switch (output) {
case "css":
path = path.replace(ext, ".css");
type = "style";
break;
case "js":
type = "script";
break;
}
info && log.info("Reloading due to changes...");
message =
message =
`event: ${eventName}\n` +
`data: ${JSON.stringify({
path,
type
})}\n\n`;
`data: ${JSON.stringify(data)}\n\n`;
}

@@ -87,2 +71,25 @@

</script>`);
function transformProcessedInfo(path) {
const base = basename(path);
const ext = extname(path);
let type = "other";
const config_regex = /^_(multiconfig|config(\..+)?)\.yml/;
if (config_regex.test(base)) {
type = "config";
}
else {
const output = hexo.extend.renderer.getOutput(path);
path = "/" + path.replace(/^source\//, "").replace(ext, `.${output}`);
type = {
css: "style",
js: "script"
}[output];
}
return {
path,
type
};
}
});
{
"name": "hexo-server-live",
"version": "0.2.8",
"version": "0.2.9",
"description": "Live reload while source file changed for Hexo.",

@@ -5,0 +5,0 @@ "main": "index",

# hexo-server-live
[![NPM version](https://badge.fury.io/js/hexo-server-live.svg)](https://www.npmjs.com/package/hexo-server-live)
[![NPM download](https://img.shields.io/npm/dt/hexo-server-live)](https://www.npmjs.com/package/hexo-server-live)

@@ -5,0 +6,0 @@ Live reload when source files change for [Hexo]. Support PJAX and Hot-reloading CSS.