create-file-tree
v1.0.0
Published
Create a file tree
Downloads
3
Readme
create-file-tree
Create a file tree
Table of Contents
Install
This project uses node and npm.
$ npm install create-file-tree
$ # OR
$ yarn add create-file-tree
Usage
const createFileTree = require('create-file-tree')
const base = process.cwd()
const tree = {
foop: {
type: 'dir',
bar: {
type: 'file',
ext: 'js',
content: 'foo bar baz'
},
baz: {
type: 'dir',
ping: {
type: 'file'
}
}
}
}
createFileTree(tree, base)
// Creates following tree in current working dir
//
// foop/
// ├── bar.js
// └── baz
// └── ping
// 1 directory, 2 files
Contribute
- Fork it and create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
License
MIT