# elysius

> Find files and directories by traversing

Latest version **2.0.2** (published 2025-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install elysius
pnpm add elysius
yarn add elysius
bun add elysius
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2025-11-08 |
| First published | 2023-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Lucas Nørgård |
| Maintainers | luxass |

## Links

- npm: https://www.npmjs.com/package/elysius
- Repository: https://github.com/luxass/elysius
- Issues: https://github.com/luxass/elysius/issues
- npm.io page: https://npm.io/package/elysius

## Recent versions

- 2.0.2 (latest) — 2025-11-08
- 2.0.1 — 2025-11-08
- 2.0.0 — 2025-07-25
- 1.4.0 — 2025-01-12
- 1.3.2 — 2024-10-05
- 1.3.1 — 2024-07-20
- 1.3.0 — 2024-07-11
- 1.2.0 — 2024-06-30
- 1.1.2 — 2024-05-19
- 1.1.1 — 2024-05-19
- 1.1.0 — 2024-05-19
- 1.0.4 — 2024-05-19
- 1.0.3 — 2024-05-19
- 1.0.2 — 2024-05-19
- 1.0.1 — 2024-01-07
- … 6 more at https://npm.io/package/elysius/versions

## README

# elysius

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![jsr version][jsr-version-src]][jsr-version-href]

## 📦 Installation

```sh
npm install elysius
```

## 📚 Usage

```ts
import { find, findSync, walk, walkSync } from "elysius";

const path = await find("package.json"); // returns `null` if not found
const path = findSync("package.json"); // returns `null` if not found

const path = await find(["package.json", "tsconfig.json"]); // returns the first found file
const path = findSync(["package.json", "tsconfig.json"]); // returns the first found file

const path = await find(["package.json", "tsconfig.json"], {
  cwd: "src",
  async test(path) {
    const base = basename(file);
    if (base === "package.json") {
      const content = JSON.parse(await readFile(file, "utf-8"));
      return content.version;
    }
    return false;
  }
}); // returns `package.json` if it has a version field

const path = findSync(["package.json", "tsconfig.json"], {
  cwd: "src",
  test(path) {
    const base = basename(file);
    if (base === "package.json") {
      const content = JSON.parse(readFileSync(file, "utf-8"));
      return content.version;
    }
    return false;
  }
}); // returns `package.json` if it has a version field

for await (const entry of walk("src")) {
  console.log(entry); // prints one file at a time
}

const paths = Array.fromAsync(walk("src")); // returns an array of all files in `src`

for (const entry of walkSync("src")) {
  console.log(entry); // prints one file at a time
}

const paths = Array.from(walkSync("src")); // returns an array of all files in `src`
```

## 📄 License

Published under [MIT License](./LICENSE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/elysius?style=flat&colorA=18181B&colorB=4169E1
[npm-version-href]: https://npmjs.com/package/elysius
[npm-downloads-src]: https://img.shields.io/npm/dm/elysius?style=flat&colorA=18181B&colorB=4169E1
[npm-downloads-href]: https://npmjs.com/package/elysius
[jsr-version-src]: https://jsr.io/badges/@luxass/elysius?style=flat&labelColor=18181B&logoColor=4169E1
[jsr-version-href]: https://jsr.io/@luxass/elysius

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