New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

git-watch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-watch

Like watch but only on files which change using git status

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Git Watch

Like node-watch but only run when things change when using git status

Installation

npm install git-watch

Usgae

Node

const gitWatch = require('git-watch')

gitWatch(__dirname, (gitError, fileName, watchEvent, gitStatus) => {
    console.log(fileName, watchEvent)
})

gitError is null unless git errors, e.g. not a git repo

fileName is the name of the file which has changed

watchEvent see node-watch but things like change and remove

gitStatus is the response from git status

CLI

You can even use this from the command line

git-watch --dir=./ --cmd="npm test --filter=$1"

it replaces $1 with the file which has changed

options

--dir | -d is the directory to watch, defaults to process.cwd()
--cmd | -c is the command to run, will append the file name to the end of the cmd or replaces all $1 with the file which has changed
--help | -h to get some sort of help message

if you don't want to execute then just stick a # on the end e.g. npm test # because # is just a comment right?

Keywords

git

FAQs

Package last updated on 09 Jun 2017

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