Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
express-static-livereload
Advanced tools
a express middleware to livereload static files
$ npm install express-static-livereload --save-dev
var express = require('express');
var app = express();
var server = require('http').Server(app);
if (app.get('env') === 'development') {
var reload = require('express-static-livereload');
app.use(reload({
server: server,
path: 'public'
}));
}
server.listen(3000);
var defaluts = {
path: 'public',
match: /<body[^>]*>/i,
filter: function(filename) {
return !/node_modules/.test(filename);
},
delay: 1000,
console: false
};
path
type
: string/array
监听变化的目录。可以是目录名字符串或者数组。
match
默认匹配body
开始标签,将相关脚本插入到body
开始标签之后,可以根据情况修改。console
:true
的时候可以改成插入到head
,可以监听到所有js的报错,并发送到server控制台。
filter
过滤不需要监听的文件。默认过滤掉path
目录下面node_modules
目录下文件。
delay
修改相同文件同步操作的最小时间间隔。默认1000ms
console
是否劫持浏览器console
。开启之后会把浏览器的console
信息以及错误信息传输到server控制台。如果要在浏览器控制台使用自带的console
功能,请使用__console
代替。
FAQs
a express middleware to livereload static files
The npm package express-static-livereload receives a total of 2 weekly downloads. As such, express-static-livereload popularity was classified as not popular.
We found that express-static-livereload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.