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

@secretlint/walker

v13.0.0

Published

Promise-based file system walker with nested .gitignore cascade support.

Readme

@secretlint/walker

Promise-based file system walker with nested .gitignore cascade support.

Install

npm install @secretlint/walker

Requires Node.js >= 22.

Usage

import { walk } from "@secretlint/walker";

const files = await walk({
    cwd: process.cwd(),
    patterns: ["**/*.{ts,js}"],
    ignoreFiles: [".gitignore"],
    extraIgnorePatterns: ["**/.git", "**/node_modules"],
});

API

walk(options): Promise<string[]>

| Option | Type | Default | Description | |---|---|---|---| | cwd | string | (required) | Absolute or relative starting directory | | patterns | string[] | undefined | Glob patterns and/or static paths. Omit to walk all of cwd. | | ignoreFiles | string[] | [] | Names of ignore files honoured per directory in cascade order (e.g. [".gitignore"]). | | extraIgnorePatterns | string[] | [] | Hard-coded ignore patterns added at the cascade root, before any file-based rules. | | noGlob | boolean | false | Treat all patterns as literal paths. | | followSymlinks | boolean | true | Descend into directory symlinks during search. Cascade ignore rules still see the symlink path, never the resolved target. Cycles are broken via realpath. |

Returns absolute paths with POSIX-form separators.

Pattern syntax

Two pattern languages are in play, and they are intentionally different:

  • Include patterns (patterns) are compiled with picomatch using { dot: true }. They support brace expansion (**/*.{ts,js}), ** segments, character classes, and ? — the same dialect as globby/micromatch.
  • Ignore patterns (extraIgnorePatterns and the contents of ignoreFiles) are compiled with node-ignore and follow .gitignore semantics. Brace expansion is not supported here; spell out alternatives explicitly. Trailing /** matches contents only — write **/node_modules (no /**) when you want to prune the directory entry itself.

If a literal patterns entry resolves to a real on-disk path the walker treats it literally even when the name contains glob metacharacters, so callers don't need noGlob: true for filenames like input-[group].md. Pass noGlob: true to force literal handling for every entry — for example when the file does not exist yet on disk.

Semantics

  • Cascade ignore: each directory's ignore-file rules are layered on top of the parent's, with negation rules evaluated against the chain root → leaf. Modeled after BurntSushi/ripgrep's ignore crate.
  • When a directory matches an ignore rule, the walker does not call readdir on it (subtree pruning).
  • Directory symlinks are followed by default (followSymlinks: true). The symlink's path — not the resolved target — drives ignore matching, and realpath is used to detect cycles.
  • ENOENT / EACCES during readdir / stat / ignore-file reads are tolerated; other I/O errors are thrown.

License

MIT © azu