npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gitwatcher

v1.0.3

Published

Watches you git commit files and warns you if somebody modified, removed or added a file that was blacklisted.

Downloads

18

Readme

Git Watcher

Build Status

Watches you git commit files and warns you if somebody modified, removed or added a file that was blacklisted.

It was done to be initially used together with travis-ci, but can be used with other CI tools as well, as long it complies to the following requirements:

  • has nodejs environment
  • allow to install npm packages
  • access to build current commit or commit range ids

Using

Configuration

Add a config file to your project, the default path is .gitwatcher.json but can be changed in runtime using the --option, then add your list of files to be watched there.

There is a sample file in the repo that can be used as a template for that.

Travis-CI Instalation and Usage

There are several ways of installing and using in your project. There are some examples bellow and a demo project here to check the usage.

using npm global instalation:

Add the following code to the before_install section of yout .travis.yml file

- npm install -g gitwatcher
- git-watcher-files --commit $TRAVIS_COMMIT_RANGE

using source directly and npm link

Add the following lines to the before_install section of your .travis.yml

- git clone https://github.com/felipesabino/gitwatcher
- cd gitwatcher
- npm install
- npm link
- cd ..
- git-watcher-files --commit $TRAVIS_COMMIT_RANGE

using as devDependency in your package.json (only for node.js apps)

Add gitwatcher dependency to your package.json devDependencies section

...
  "devDependencies": {
    "gitwatcher": "*"
  }
...

And then the following code to the before_script section of yout .travis.yml file

- ./node_modules/.bin/git-watcher-files --commit $TRAVIS_COMMIT_RANGE

Important: Notice that the instalation using devDependency needs the script to be added to before_script as it will depend on an npm install which travis does automatically at the install step. Check the build lifecycle documentation for more information.

Testing locally

Execute to get a list of files that were modified and should not have been.

$ git-watcher-files --commit SHA1..SHA2

This SHA1..SHA2 can be the same format used by github's compare view url or travi's TRAVIS_COMMIT_RANGE environment variable

Hint: You can easily check the files modified by each commit using $git diff --name-status

Developers

After cloning this repo you must run npm install

Then you can run the tests:

$ npm run test
$ npm run lint

Or execute locally with npm link

$ npm link
$ git-watcher-files -h

Contributing

Just fork and send me your pull request

Remarks

First step trying to improve stability and maintainability of large git repository with lots of contributors.

License

License