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

peep

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peep

Peep is a smart fs.watch wrapper which is lighter and faster, uses as less fs.FSWatchers as possible, and could prevent duplicate watching.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Peep

Peep is a smart fs.watch wrapper which is lighter and faster. It uses as less fs.FSWatchers as possible, and could prevent duplicate watching.

Peep has a better .add() method which could automatically detect nested structures between the current watched files and directories, and choose the best strategy to make it fast and of less resources usage.

Installation

npm install peep --save

Usage

var peep = require('peep')();

peep
	.on('all', function(event, path){
	    console.log(event, path);
	})
	.add('test/foo.js')
	.add('test') // 'test' contains 'test/foo.js'

Peep doesn't depend on 'globule' module. If you prefer the feature of globbing files, you could do this:

var globule = require('globule');

peep.add( globule.find('test/**/*.js') );

Methods

peep.add(path[, path, ...])
peep.add(paths)

Adds file(s) or directories to be watched

peep.add('test/foo.js', 'test/foo2.js');
peep.add(['test/foo.js', 'test/foo2.js']);
peep.remove(path[, path, ...])
peep.remove(paths)

Removes file(s) or directories from being watched.

peep.remove()

Removes all watched files and directories.

peep.watched()
Returns Array.<String>

The current watched files.

Events

What's comming...

Keywords

FAQs

Package last updated on 26 Sep 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