1.0.0 • Published 5 years ago

create-file-tree v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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