0.1.2 • Published 5 years ago

to-file-tree v0.1.2

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
5 years ago

ToFileTree is a package that turns a flat list of file paths into a directory structure.

usage:

import toFileTree  from 'toFileTree'

const files = ['index.html', 'content/index.html', 'content/leaf/index.html']
const fileTree = toFileTee(files)

fileTree will have a value of

{
    files: ['index.html'],
    directories: {
        'content': {
            files: ['index.html'],
            directories: {
                'leaf': {
                   files: ['index.html']
                }
            }
        }
    }
}

Debugger config for vscode

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Jest Tests",
            "type": "node",
            "request": "launch",
            "runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand"],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen"
        }
    ]
}
0.1.2

5 years ago

0.1.0

5 years ago