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

@obsidian-vfs/core

v0.3.1

Published

Core library for Obsidian VFS — vault resolution, content processing, path security

Readme

@obsidian-vfs/core

Shared engine for Obsidian VFS. Provides obs:// URI resolution, file I/O, Obsidian CLI integration, LRU caching, and content processing used by all consumer packages.

Responsibilities

  • URI resolutionobs:// scheme handling, @obs: context mentions, /obs: skill mentions, [[wikilink]] resolution.
  • File I/O — Direct reads via node:fs (bypassing the CLI for performance), directory enumeration, file watching.
  • Obsidian CLI wrapper — Async queue-serialized calls to the obsidian binary for search, backlinks, vault discovery. JSON and plain-text response parsing.
  • Content processing — Section slicing by #heading, [[wikilink]] scrubbing to obs:// URIs, ![[embed]] transclusion, Markdown link parsing.
  • Frontmatter — Extraction, curation, and formatting of YAML frontmatter. Model field mapping to Claude model identifiers via mapModelToClaude().
  • Mount tree — Pure visibility logic for partial autoMount paths. Used by VSCode to compute files.exclude sub-directory exclusions that match tree view visibility.
  • Caching — Generic LRUCache<K, V> with TTL expiration.
  • Securitypath.resolve + vault-root prefix check on all I/O. Symlink rejection outside vault. allowed/blocked enforcement on general vault content; agents/skills implicitly allowed.
  • Configuration — Vault config from .obsidian/obsidian-vfs.json (agents, skills, allowed, blocked).

Exports

The package exposes two entry points:

| Entry | Path | Purpose | |-------|------|---------| | . | dist/index.js | All production exports | | ./testing | dist/test-helpers.js | Test utilities and mocks |

Testing Utilities

The ./testing entry point provides test doubles for consumer packages:

| Utility | Description | |---------|-------------| | mockCLI(overrides?) | Fully-stubbed ObsidianCLI mock with optional per-method overrides | | mockFsFunction(fn) | Type-safe cast wrapper for mocked node:fs/promises functions | | makeLocalIndexTrackerWith(methodName, result, extraMethods?, contextOverrides?) | Build a mock LocalIndexTracker whose single method resolves to a given VFSResult | | makeDiscoveredResource(overrides?) | Build a DiscoveredResource with sensible defaults |

Key Exports

| Category | Symbols | |----------|---------| | Resolution | resolveMention, resolveSkillMention, resolveWikilink, normalizeMention, parseSection | | File I/O | readVirtualFile, listMarkdownFiles, listFolders, readDirectory | | CLI | ObsidianCLI, resolveExecConfig, resolveCliPath | | Content | sliceContent, scrubWikilinks, processContent, resolveEmbeds, maskCodeRegions | | Frontmatter | extractFrontmatter, extractCuratedFrontmatter, remapModelLine, mapModelToClaude | | Types | VFSResult, VFSError, VFSConfig, ErrorCode, MentionKind | | Mount tree | buildMountTree, MountNode | | Utilities | LRUCache, LocalIndexTracker, AsyncQueue | | Constants | URI_SCHEME, URI_PREFIX, MENTION_PREFIX, SKILL_PREFIX |

Result Types

All fallible operations return VFSResult<T>, a discriminated union:

type VFSResult<T> = { ok: true; value: T } | { ok: false; error: VFSError };

No nulls, no thrown exceptions for expected failures.

CLI Parsing Convention

The Obsidian CLI returns different formats per command:

  • search, backlinks → JSON
  • vault, files, folders, read → plain text
  • Exit code is always 0; detect errors via Error: prefix in stdout.

Degraded Mode

When Obsidian is not running, the core falls back to node:fs for reads and enumeration. Search and wikilink resolution are unavailable in this mode.