trucks-transform-tree

1.0.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    6
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i trucks-transform-tree

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • muji
  • tmpfs