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 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-syncd

v1.1.1

Published

A library to keep git repositories in sync via git pull

Readme

git-syncd

Keep your git repositories in sync via git pull.

Available in: 中文 | Deutsch | Español | Français | 日本語

Installation

npm install git-syncd

Usage

gitSyncd — One-time sync

import { gitSyncd } from "git-syncd";

// Sync the current working directory
const result = await gitSyncd();

// Sync a specific directory
const result = await gitSyncd({ cwd: "/path/to/repo" });

// When there are uncommitted local changes, force discard and pull (default behavior)
const result = await gitSyncd({ cwd: "/path/to/repo", force: true });

if (result.success) {
  console.log(result.stdout);
  if (result.forceReset) {
    console.warn("Local changes were discarded and force-synced");
  }
} else {
  console.error(result.stderr);
}

gitSyncdJob — Scheduled sync

import { gitSyncdJob } from "git-syncd";

// Start scheduled sync (runs once immediately, then every 30 seconds)
const job = gitSyncdJob({
  cwd: "/path/to/repo",
  interval: 30_000, // recommended value, default
  onSync: (result) => {
    if (result.success) {
      console.log("[sync] OK", result.stdout);
    } else {
      console.error("[sync] FAIL", result.stderr);
    }
  },
});

// Stop when needed
job.stop();

Recommended interval: 30000 (30 seconds). Each git pull only transfers data when there are new commits. Idle polling consumes negligible network and CPU resources, and a 30-second interval keeps code in sync within half a minute with minimal system overhead.

API

gitSyncd(options?)

Options

| Option | Type | Default | Description | | ------- | ---------- | --------------- | ------------------------------------------------------------------------------------------------------------ | | cwd | string | process.cwd() | Target git repository path | | args | string[] | [] | Additional arguments to pass to git pull | | force | boolean | true | If pull fails due to local changes, automatically run git reset --hard HEAD to discard changes and retry |

Result

| Field | Type | Description | | ------------ | --------- | ------------------------------------------------------------- | | success | boolean | true when exit code is 0 | | stdout | string | Standard output | | stderr | string | Standard error | | exitCode | number | Process exit code | | forceReset | boolean | true when a forced reset was triggered, otherwise undefined |


gitSyncdJob(options?)

Options

Inherits all options from gitSyncd, plus:

| Option | Type | Default | Description | | ---------- | ---------------------------------- | ------- | -------------------------------------------------------------- | | interval | number | 30000 | Sync interval in milliseconds, recommended 30000 | | onSync | (result: GitSyncdResult) => void | — | Callback invoked after each sync, useful for logging or alerts |

Returns: GitSyncdJob

| Method | Description | | -------- | ------------------------ | | stop() | Stop the scheduled sync |

License

MIT