Back to Explore

vfile/vfile-location

GitHub
1 watchersOpen source

Last release:

vfile-location is a small utility for vfile that converts between positional locations in a text file (line and column) and offset-based locations (range-based index positions). It is useful when you need to search raw file content or report AST findings using line and column coordinates for users.

Project status

  • Maintenance status: Evidence suggests the project is quiet/dormant rather than actively maintained as of 2026-06-09, with the last known upstream push on 2024-10-22 and the newest published updates (5.0.3) on 2024-07-15.
  • Apparent update cadence: Updates have been sporadic, with multi-year gaps between versions (for example, 2021-07, 2023-02 to 2023-08, then 2024-07), and no updates shown in the last many months relative to today.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 5.0.3

    Release 5.0.3 focuses on a performance refactor (lazy indexing) and a fix for out of bounds columns handling. The code changes go beyond the release notes by also introducing new/changed TypeScript declarations and altering some runtime edge case behavior around invalid column values.

  • 5.0.2

    v5.0.2 contains a dependency and tooling update only, with no application logic changes shown in the diff. The package.json changes bump @types/unist, prettier, and xo, and adjust lint configuration and the prettier CLI flag.

  • 5.0.1

    Release 5.0.1 is described in the release notes as a types-only update related to `vfile`. The actual diff shows a broader set of changes, including dependency major version bumps and TypeScript configuration updates.

  • 5.0.0

    vfile-location 5.0.0 makes its position conversion APIs return undefined for invalid or out-of-bounds inputs, instead of returning sentinel values (like -1 or an object with undefined fields). It also formalizes the package entrypoints via an exports map and raises the minimum Node.js requirement to Node 16.

    Breaking
  • 4.1.0

    Release 4.1.0 adds an export of the `Location` type, expanding the library’s public TypeScript surface for consumers. The rest of the changes are mainly documentation improvements, internal code-style refactoring, and a `tsconfig.json` update with no explicitly stated behavioral impact.

    Features
  • 4.0.1

    Release 4.0.1 is primarily a maintenance update focused on type correctness. The release notes state that it fixes types by adding `vfile` as a dependency.

  • 4.0.0

    vfile-location 4.0.0 switches the package to ESM and rewrites the implementation to use JSDoc-based types. The runtime API shape has changed: the exported entry point is now an ESM named export, and the returned transform object no longer includes the deprecated `toPosition` alias.

    BreakingFeatures
  • 3.2.0

    v3.2.0 adds support for carriage-return based line endings (CR and CRLF) when converting between offsets and line/column points. The implementation changes how line-break indices are computed and also tightens validation behavior for some invalid inputs to `toOffset`.

    Features
  • 3.1.0

    Release 3.1.0 updates the public API naming from “position” to “point” by introducing `toPoint`. The code also adjusts TypeScript types to match the new terminology while keeping backward compatibility for `toPosition`.

    Features
  • 3.0.1

    Release 3.0.1 has extremely minimal release notes, mentioning only prose refactoring and metadata updates. The actual diff shows small documentation/metadata edits, plus changes to TypeScript type-test imports and bumps to development tooling dependencies.