New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

big-eye

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big-eye

Execute commands on file changes

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Logo

Execute specified command on file change(s)

Travis build AppVeyor build Coveralls

Video

Install

$ npm install [-g] big-eye

Usage

CLI

$ eye --help

	Usage
	  $ eye <command>

	Options
	  -w, --watch    Files/directories to be watched [Default: pwd]
	  -i, --ignore   Files/directories to be ignored [Default: from .gitignore]
	  -l, --lazy     Don't execute command on startup
	  -d, --delay    Debounce delay in ms between command executions [Default: 100]
	  -q, --quiet    Print only command output

	Examples
	  $ eye app.js
	  $ eye build.js -w src/
	  $ eye python module.py -i '*.pyc'
	  $ eye 'g++ main.cpp && ./a.out'

	Tips
	  Run eye without arguments to execute the npm start script.

API

bigEye(file, [args], [options])

Execute file with args when a file matching the options.watch array gets modified. Returns a new Eye instance.

file

Type: String

Absolute path to the file to be executed. Must be a non-empty String.

args

Type: Array

Arguments that will be passed to child process when executing file.

options

Type: Object

Options object that can take the following keys:

watch

Type: Array, String

Path(s) to files, dir(s) to be watched recursively, or glob pattern(s).

ignore

Type: anymatch compatible definition

Path(s) to files, dir(s) to be ignored, regex(es), or glob pattern(s).

lazy

Type: Boolean
Default: false

If set to true, don't execute file after constructing the instance, but only on watched file change.

delay

Type: Number
Default: 100

Delay in ms when debouncing execution after file changes.

Events

Each Eye instance inherits from EventEmitter and emits a handful of events:

.on('executing', ref)

When a new child process is spawned. ref is an instance of child_process.

on('changes', file)

Debounced file changes that trigger spawning a child process. file is a path to the file that caused the event.

.on('exited', time, code)

When a child has exited. time is its execution time in miliseconds, code is its exit code.

.on('killed', signal)

When a child was killed due to file changes, signal represents the signal used to :knife: it.

License

MIT © nikersify

FAQs

Package last updated on 21 Jun 2019

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