2.2.0 • Published 10 years ago

tree-view v2.2.0

Weekly downloads
35
License
BSD
Repository
github
Last release
10 years ago

tree-view

Tree viewing widget for the browser

npm install tree-view

Try out the demo by doing

npm install
npm start

Usage

var path = require('path')
var tree = require('tree-view')

var browser = tree() // or tree({style:false}) to disable styling

browser.on('directory', function(p, entry) {
  console.log('You clicked on a directory (%s)', p)
  browser.directory(p, [{
    path: path.join(p, '/foo'),
    type: 'directory'
  }, {
    path: path.join(p, '/bar'),
    type: 'directory'
  }, {
    path: path.join(p, '/baz'),
    type: 'file'
  }])
})

browser.on('file', function(p, entry) {
  console.log('You clicked on a file (%s)', p)
})

browser.directory('/', [{
  path: '/foo',
  type: 'directory'
}, {
  path: '/bar',
  type: 'directory'
}, {
  path: '/baz',
  type: 'file'
}])

browser.appendTo(document.body)
2.2.0

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago