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

yolowatch

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yolowatch

watch filesystem changes yolostyle

Source
npmnpm
Version
2.3.0
Version published
Weekly downloads
5
66.67%
Maintainers
3
Weekly downloads
 
Created
Source

yolowatch

Watch changes to subdirectories and subfiles within a given directory.

Uses the filewatcher module to fall back on polling the filesystem when ulimit is reached.

npm install yolowatch

Example

var yolowatch = require('yolowatch')

var watcher = yolowatch('/path/to/my/dir', opts)

watcher.on('changed', function (file, data) {
  console.log(file, 'was changed')
  console.log('is a', data.type) //'file', 'directory'
})

watcher.on('deleted', function (file) {
  console.log(file, 'was deleted')
})

watcher.on('added', function (file, data) {
  console.log(file, 'was added')
})

Example data in callback (see folder-walker):

{
  basename: 'index.js',
  relname: 'test/index.js',
  root: '/Users/karissa/dev/node_modules/folder-walker',
  filepath: '/Users/karissa/dev/node_modules/folder-walker/test/index.js',
  stat: [fs.Stat Object],
  type: 'file' // or 'directory'
}

Options

  • Second argument, opts, is passed to filewatcher.
  • Ignore files: opts.filter passed to folder-walker.

Todo

  • expose options to pass to filewatcher module (check this)
  • function to remove directory & children from being watched.

FAQs

Package last updated on 30 Jun 2016

Did you know?

Socket

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.

Install

Related posts