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

gaze

Package Overview
Dependencies
Maintainers
3
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.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
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 21 May 2018

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