Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
##DirWatcher 监视你的目录
监控指定目录中文件的增加,删除,修改,子目录的增加,删除等
安装 npm install DirWatcher
var dw = require( './DirWatcher' );
dw.watchDir( 'path', function( ifDir, path, cur, pre ){
// ifDir 是否为目录
// path 文件或者目录的路径
// type 变更类型 'modify' 'remove' 'add'
// cur 当文件变更时,包含当前文件的信息
// pre 当文件变更时,包含变更前文件信息
});
###API
####watchDir( path, next )
path
: 目录的路径next
: 回调,包含五个个参数ifDir
, path
, type
, cur
, pre
####readDir( path, next )
对制定目录进行递归便利,对每一个有效路径执行一次回调
path
: 目录的路径next
: 回调,为目录下的每一个文件或者子目录执行一次回调。回调包含###Exception 配置例外
可以通过在需要添加例外的目录下添加名为.nowatch
文件,来添加例外. 例外添加的规则:
#
进行注释/
结尾的例外将被视为目录,否则为具体的文件名###存在的问题
EMFILE
的错误watch
该路径(对于目录应该问题不大,但是对于文件,暂时无法解决)
hahFAQs
A simple tool for you to watch a directory
We found that DirWatcher 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.