Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
##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
The npm package DirWatcher receives a total of 2 weekly downloads. As such, DirWatcher popularity was classified as not popular.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.