🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@jsonjoy.com/fs-print

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonjoy.com/fs-print

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

latest
Source
npmnpm
Version
4.57.2
Version published
Weekly downloads
4.2M
-21.71%
Maintainers
2
Weekly downloads
 
Created
Source

@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

npm install @jsonjoy.com/fs-print

Usage

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:

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

Keywords

filesystem

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts