1.0.2 • Published 8 years ago

trucks-transform-tree v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Tree Transform

Humanize the component tree

Converts the component tree to another tree suitable for passing to archy.

Install

npm i trucks-transform-tree --save-dev

For the command line interface see trucks-cli.



Usage

Use the tree key to configure this transform:

const trucks = require('trucks');

trucks(
  {
    files: ['components.html'],
    transforms: ['tree'],
    conf: {
      transforms: {
        tree: {
          label: (tag, id) => {
            return tag + '#' + id; 
          }
        }
      }
    }
  }, (err, state) => {
    if(err) {
      throw err; 
    }
    console.log(state.result.tree.toString());
  }
);

License

MIT


Created by mkdoc on July 18, 2016

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago