# @jsonjoy.com/fs-print

> File system tree printer - print a file system structure as a tree

Latest version **4.78.1** (published 2026-09-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @jsonjoy.com/fs-print
pnpm add @jsonjoy.com/fs-print
yarn add @jsonjoy.com/fs-print
bun add @jsonjoy.com/fs-print
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 4.78.1 |
| Published | 2026-09-17 |
| First published | 2026-01-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2091 |
| Author | streamich |
| Maintainers | json-joy-team, streamich |
| Keywords | filesystem, fs, tree, print, visual, directory, structure, debug |

## Links

- npm: https://www.npmjs.com/package/@jsonjoy.com/fs-print
- Repository: https://github.com/streamich/memfs
- Homepage: https://github.com/streamich/memfs/tree/master/packages/fs-print
- Issues: https://github.com/streamich/memfs/issues
- Funding: https://github.com/sponsors/streamich
- npm.io page: https://npm.io/package/@jsonjoy.com/fs-print

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 4.78.1 (latest) — 2026-09-17
- 4.78.0 — 2026-09-13
- 4.77.0 — 2026-09-13
- 4.76.0 — 2026-09-12
- 4.75.0 — 2026-09-11
- 4.74.0 — 2026-09-10
- 4.73.0 — 2026-09-10
- 4.72.2 — 2026-09-10
- 4.72.1 — 2026-09-09
- 4.72.0 — 2026-09-09
- 4.71.1 — 2026-09-09
- 4.71.0 — 2026-09-04
- 4.70.0 — 2026-09-04
- 4.69.1 — 2026-09-02
- 4.69.0 — 2026-09-02
- … 31 more at https://npm.io/package/@jsonjoy.com/fs-print/versions

## README

# @jsonjoy.com/fs-print

File system tree printer - print a file system structure as a tree.

Provides a simple API to print any filesystem implementing the `FsSynchronousApi` interface
as a formatted tree structure, useful for debugging and visualization.

## Installation

```bash
npm install @jsonjoy.com/fs-print
```

## Usage

```ts
import { toTreeSync } from '@jsonjoy.com/fs-print';
import { memfs } from 'memfs';

const { fs } = memfs({
  '/readme.md': '...',
  '/src/index.ts': '...',
  '/src/util.ts': '...',
});

console.log(toTreeSync(fs));
```

Output:

```
/
├─ src/
│  ├─ index.ts
│  └─ util.ts
└─ readme.md
```

## Options

You can customize the output with options:

```ts
toTreeSync(fs, {
  dir: '/src', // Starting directory (default: '/')
  depth: 2, // Maximum depth to traverse (default: 10)
  separator: '/', // Path separator (default: '/')
  tab: '  ', // Indentation string (default: '')
  sort: true, // Sort entries (default: true)
});
```

## License

Apache-2.0

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