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

@vilancer/filelinks-git-hook

v1.2.1

Published

Install a filelinks check into git pre-commit hooks (plain .git/hooks or husky). Provides the filelinks-git-hook binary.

Readme

@vilancer/filelinks-git-hook

npm

Run filelinks check automatically on every commit. This package ships the filelinks-git-hook binary, which installs a small, idempotent block into your git pre-commit hook — plain .git/hooks or husky.

Install

pnpm add -D @vilancer/filelinks @vilancer/filelinks-core @vilancer/filelinks-git-hook
# or: npm install --save-dev @vilancer/filelinks @vilancer/filelinks-core @vilancer/filelinks-git-hook

You also need a filelinks.config.ts (run npx filelinks add to create one). Requires Node.js 20+.

Plain git hooks

npx filelinks-git-hook install

This writes the hook at git rev-parse --git-path hooks/pre-commit (so worktrees and core.hooksPath are respected) and makes it executable:

# >>> filelinks >>>
if [ "$FILELINKS_SKIP" != "1" ]; then
  npx --no-install filelinks-git-hook run || exit $?
fi
# <<< filelinks <<<

If the hook already exists, the block is inserted right after the shebang, so the check runs first and your script keeps its own control flow (a hook ending in exit 0 or exec … would never reach an appended block, and a failing last command would be masked by it). Re-running install replaces the block in place; uninstall gives back the original file.

| Option | Default | Meaning | | ----------------- | ----------------------------------------- | ----------------------------- | | --hook <name> | pre-commit | Which git hook to write | | --command <cmd> | npx --no-install filelinks-git-hook run | Command inside the block | | --husky | auto | Write to .husky/<hook> | | --cwd <dir> | current dir | Any directory inside the repo |

Husky (v9)

npx husky init                          # creates .husky/pre-commit
npx filelinks-git-hook install --husky  # adds the filelinks block at the top

If a .husky/ directory already exists at the repo root, install targets it automatically. Prefer to do it by hand? Add one line to .husky/pre-commit:

npx --no-install filelinks check

lint-staged

lint-staged appends the matched file paths to each command. filelinks check reads the staged set from git itself, so use the function form — it runs once, with no file arguments:

// lint-staged.config.mjs
export default {
  '*.{ts,tsx}': 'eslint --fix',
  '*': () => 'filelinks check',
};

Then keep npx lint-staged in your hook (for example .husky/pre-commit). Use either this or the install block, not both.

run

The hook calls filelinks-git-hook run, which runs filelinks check in-process and exits with its code:

filelinks-git-hook run [--cwd <dir>] [--config <path>] [--run-agents [--stage-fixes]] [--json]

Skipping a commit check

FILELINKS_SKIP=1 git commit -m "wip"   # skip filelinks only
git commit --no-verify -m "wip"        # skip all hooks

AI agents on commit

Agents are opt-in. Install the hook with a custom command:

npx filelinks-git-hook install --command "npx --no-install filelinks-git-hook run --run-agents --stage-fixes"

--stage-fixes stages the companions the agent wrote, so the commit goes through once they are fixed. Without it, the hook still fails and lists the files to git add.

Credentials must be available to the hook: CURSOR_API_KEY for Cursor; for Claude Code either the device login (claude.auth: 'device') or CLAUDE_CODE_OAUTH_TOKEN (claude.auth: 'token'), from the env or .env.local.

Uninstall

npx filelinks-git-hook uninstall            # or: --husky / --hook <name>

Removes the block; if only a shebang is left, the hook file is deleted.

Related packages

| Package | npm | Role | | ----------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------- | | @vilancer/filelinks | npm | CLI binary | | @vilancer/filelinks-core | npm | defineLinks, matching, agent providers | | @vilancer/filelinks-git-hook (this) | npm | git / husky hook installer |

Release notes: docs/releases · Source and issues: github.com/Vilancer/filelinks