Skip to content

Print tree#929

Merged
streamich merged 9 commits into
nextfrom
print-tree
Jun 25, 2023
Merged

Print tree#929
streamich merged 9 commits into
nextfrom
print-tree

Conversation

@streamich
Copy link
Copy Markdown
Owner

@streamich streamich commented Jun 25, 2023

Adds ability to print a folder as a text tree:

import { memfs } from 'memfs';

const { vol } = memfs({
  '/Users/streamich/src/github/memfs/src': {
    'package.json': '...',
    'tsconfig.json': '...',
    'index.ts': '...',
    'util': {
      'index.ts': '...',
      'print': {
        'index.ts': '...',
        'printTree.ts': '...',
      },
    },
  },
});

console.log(vol.toTree());

// Output:
// /
// └─ Users/
//    └─ streamich/
//       └─ src/
//          └─ github/
//             └─ memfs/
//                └─ src/
//                   ├─ index.ts
//                   ├─ package.json
//                   ├─ tsconfig.json
//                   └─ util/
//                      ├─ index.ts
//                      └─ print/
//                         ├─ index.ts
//                         └─ printTree.ts

@streamich streamich merged commit 558c001 into next Jun 25, 2023
@streamich streamich deleted the print-tree branch June 25, 2023 10:30
@streamich
Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 4.1.0-next.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant