Socket
Socket
Sign inDemoInstall

yo-fs

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yo-fs

A client-side modular stream-friendly ui browser widget for navigating directories.


Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

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()
}

Keywords

FAQs

Package last updated on 14 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc