@jsonjoy.com/fs-print
File system tree printer - print a file system structure as a tree
Last updated 21 days ago by GitHub Actions .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @jsonjoy.com/fs-print 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 4.57.1                                ...           latest (21 days ago)

10 Versions

  • 4.57.1                                ...           21 days ago
  • 4.57.0                                ...           21 days ago
  • 4.56.11                                ...           a month ago
  • 4.56.10                                ...           3 months ago
  • 4.56.9                                ...           3 months ago
  • 4.56.8                                ...           3 months ago
  • 4.56.7                                ...           3 months ago
  • 4.56.4                                ...           3 months ago
  • 4.56.2                                ...           3 months ago
  • 4.56.1                                ...           3 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |