yo-fs
A client-side modular, stream-friendly ui browser widget for navigating directories, built with yo-yo.
api
yofs(widget, root, entries, onclick)
widget
: if we already have a widget, update it, otherwise make a new one.path
: the directory or filename to displayentries
: 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 onclick = function (event, entry) {
console.log('i clicked', entry)
}
var el = yofs(null, '/', entries, onclick)
document.body.appendChild(el)
var stream =
stream.on('data', function (entry) {
entries.push(entry)
yofs(widget, '/', entries, onclick)
}