# @altano/repository-tools

> Misc tools for dealing with repositories of multiple version control systems (git, svn, etc)

Latest version **2.1.3** (published 2026-11-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @altano/repository-tools
pnpm add @altano/repository-tools
yarn add @altano/repository-tools
bun add @altano/repository-tools
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2026-11-11 |
| First published | 2024-04-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Author | Alan Norbauer |
| Maintainers | altano |
| Keywords | repository, root, git, jujutsu, jj, mercurial, sapling |

## Links

- npm: https://www.npmjs.com/package/@altano/repository-tools
- Repository: https://github.com/altano/npm-packages
- Homepage: https://github.com/altano/npm-packages/tree/main/packages/repository-tools
- npm.io page: https://npm.io/package/@altano/repository-tools

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.1.3 (latest) — 2026-11-11
- 2.1.2 — 2026-10-15
- 2.1.1 — 2026-08-29
- 2.1.0 — 2026-08-18
- 2.0.5 — 2026-08-02
- 2.0.4 — 2026-08-01
- 2.0.3 — 2026-03-23
- 2.0.2 — 2026-03-23
- 2.0.1 — 2025-07-07
- 2.0.0 — 2025-06-30
- 1.0.1 — 2025-04-03
- 1.0.0 — 2025-04-03
- 0.1.1 — 2024-08-28
- 0.1.0 — 2024-08-28
- 0.0.4 — 2024-07-06
- … 2 more at https://npm.io/package/@altano/repository-tools/versions

## README

# repository-tools

[![npm](https://badgen.net/npm/v/@altano/repository-tools)](https://www.npmjs.com/package/@altano/repository-tools) ![Typed with TypeScript](https://badgen.net/npm/types/@altano/repository-tools) ![ESM only](https://badgen.net/badge/module/esm%20only?icon=js)

Misc tools for dealing with repositories of multiple version control systems

## Supported Version Control Systems

- git
- jujutsu (jj), colocated with git or not
- mercurial
- sapling
- subversion

## Tools

### findRoot[Sync]

Given a path inside a repository, find the path of the root

Example:

```ts
findRootSync("/my-git-repo/some/subdirectory"); // => "/my-git-repo"
```

Example:

```ts
await findRoot("/my-git-repo/some/subdirectory"); // => "/my-git-repo"
```

## Importing

NOTE: As of v1.0.0 this is an ESM-only module package. It can be imported as an ESM module from any Node.js version but if requiring this package from a CJS package, you must use Node.js v20.19.0+ or v22.12.0+. If you get a `ERR_REQUIRE_ESM` error when calling `require("@altano/repository-tools")` make sure you're on a new enough version of Node.js.

You may import all the tools, or import functions directly:

| Using sub-path exports | Import to use                                                      |
| ---------------------- | ------------------------------------------------------------------ |
| No                     | `import { findRoot } from "@altano/repository-tools";`             |
| Yes                    | `import { findRoot } from "@altano/repository-tools/findRoot.js";` |

---
_Source: https://npm.io/package/@altano/repository-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
