dir-tree-obj
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

dir-tree-obj

Build Status npm version Node.js Version

Create a JavaScript object representing the structure of a directory

Installation

yarn add dir-tree-obj

Usage

Assume a directory named dir with the following structure:

├── a.txt
├── b.txt
└── sub
    ├── a.js
    ├── a.txt
    └── b.txt
import dirTreeObj from 'dir-tree-obj';

dirTreeObj('./dir');
/**
 * Prints: {
    '.': ['a.txt', 'b.txt'],
    sub: {
      '.': ['a.js', 'a.txt', 'b.txt'],
    },
  }
 */

Note: file names are always sorted.

Readme

Keywords

none

Package Sidebar

Install

npm i dir-tree-obj

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.96 kB

Total Files

8

Last publish

Collaborators

  • mgenware