3.0.3 • Published 9 years ago

yo-fs v3.0.3

Weekly downloads
8
License
BSD-2-Clause
Repository
github
Last release
9 years ago

yo-fs

A client-side modular, stream-friendly ui browser widget for navigating directories, built with yo-yo.

NPM

api

yofs(path, entries, onclick)

  • path: the directory or filename to display
  • entries: a list of entries with name, size, modified, createReadStream
  • onclick: fires when a folder, file, or back button is clicked.

example

var yofs = require('yo-fs')
var yo = require('yo-yo')

var entries = []

function onclick (event, entry) {
  console.log('i clicked', entry)
}

// only create the top-level element once
var el = yofs('/', entries, onclick)
document.body.appendChild(el)

// update the tree's internal html widget using yo
function update () {
  var fresh = tree.render('/', entries, onclick)
  yo.update(tree.widget, fresh)
}

var stream = //stream that gives me some data...

stream.on('data', function (entry) {
  entries.push(entry)
  update()
}
3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago