Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gaze

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gaze

A globbing fs.watch wrapper built from the best parts of other fine watch libs.

  • 0.4.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3M
increased by5.28%
Maintainers
1
Weekly downloads
 
Created

What is gaze?

The 'gaze' npm package is a file watcher that uses native OS events to notify you of changes to files and directories. It is useful for tasks such as automatically reloading a server, rebuilding assets, or running tests when files change.

What are gaze's main functionalities?

Watch Files

This feature allows you to watch for changes in JavaScript files in the current directory. When a change is detected, it logs the event type and the file path.

const gaze = require('gaze');
gaze('*.js', function(err, watcher) {
  if (err) throw err;
  console.log('Watching files...');
  this.on('all', function(event, filepath) {
    console.log(event + ': ' + filepath);
  });
});

Watch Directories

This feature allows you to watch for changes in JavaScript files within the 'lib' directory and its subdirectories. It logs the event type and the file path when a change is detected.

const gaze = require('gaze');
gaze('lib/**/*.js', function(err, watcher) {
  if (err) throw err;
  console.log('Watching directories...');
  this.on('all', function(event, filepath) {
    console.log(event + ': ' + filepath);
  });
});

Get Watched Files

This feature allows you to retrieve a list of files currently being watched. It logs the list of watched files to the console.

const gaze = require('gaze');
gaze('*.js', function(err, watcher) {
  if (err) throw err;
  console.log('Watching files...');
  console.log(this.watched());
});

Other packages similar to gaze

Keywords

FAQs

Package last updated on 19 Oct 2013

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc