create-file-tree

1.0.0 • Public • Published

create-file-tree

package version package downloads standard-readme compliant package license make a pull request

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

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i create-file-tree

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.96 kB

Total Files

5

Last publish

Collaborators

  • tiaanduplessis