to-file-tree
v0.1.2
Published
ToFileTree is a package that turns a flat list of file paths into a directory structure.
Downloads
2
Readme
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"
}
]
}