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

git-list-updated

v1.2.1

Published

Resolve list of updated (and existing) files between two branches

Downloads

20,932

Readme

*nix build status Windows build status Tests coverage Transpilation status npm version

git-list-updated

Resolve list of updated (and existing) files

By default it checks difference between HEAD (so current branch) and master.

Useful when we want to apply certain operations (e.g. lint) only to files that were updated and not whole repostory

Installation

npm install -g git-list-updated

Usage

CLI

git-list-updated

List updated files

git-list-updated [-h | --help] [--base=<base>] [--head=<head>] [--ext=<ext>] [<path>]

If <path> is not provided, check is done in repository at current working directory

Options:

base (defaults to master)

Base branch with which we wish to compare

head (defaults to HEAD)

Target containing the changes that should be investigated

ext

List only files with specific extensions. Multiple extensions can be chosen by passing arg multiple times. If not passed, all files are listed

pipe-git-updated

Pipe output of git-list-updated into other command. On *nix systems that could simply be achieved via:

git-list-updated [<...git-list-updated-args>] | <targetComand> [<...target-command-args>]

Purpose of this util is to provide cross environment solution that can also work on Windows

pipe-git-updated [<...git-list-updated-args>] -- <targetComand> [<...target-command-args>]

Programatically

git-list-updated

const gitListUpdated = require("git-list-updated/pipe");

gitListUpdated(respositoryRoot, {
	base: "master", // Base to compare against
	head: "HEAD" // Source for comparision
	ext: [] // Limit output to given extensions
})
	// Response object is a stream that emits each filename with individual data event
	.on("data", filename => {
		console.log(`Updated file: ${filename}`);
	})
	// Response object is also a promise that resolves with a list of updated files
	.then(fileNames => {
		console.log(`All updated files: ${fileNames}`);
	});

git-list-updated/pipe

const pipeGitUpdated = require("git-list-updated/pipe");

pipeGitUpdated(respositoryRoot, [targetCliCommand, targetCliCommandArg1, targetCliCommandArg2], {
 	// git-list-updated options
	base: "master", // Base to compare against
	head: "HEAD" // Source for comparision
	// pipe specific optons
	stdio: "inherit" // Override stdio setting of targetCli command
});

Tests

npm test