Skip to content
PACKAGES

fromGitPoll()

Poll a Git repository for new commits and emit commit-shaped graph events.

import { fromGitPoll } from "@graphrefly/ts/sources/node";
function fromGitPoll(
repoPath: string,
opts: FromGitPollOptions = {},
): Operator<never, GitEvent>
ParameterTypeDescription
repoPathstringPath to the Git repository to poll.
optsFromGitPollOptionsPoll interval, include/exclude file filters, error tolerance, and cancellation signal.

A node-only source operator that emits GitEvent values after the initial baseline commit.

import { graph } from "@graphrefly/ts/graph";
import { fromGitPoll } from "@graphrefly/ts/sources/node";
const g = graph();
const commits = g.initNode(fromGitPoll(process.cwd(), { include: ["packages/**"] }), []);

packages/ts/src/sources/node.ts