Socket
Socket
Sign inDemoInstall

yo-fs

Package Overview
Dependencies
73
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

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
4
increased by100%
Maintainers
3
Install size
4.86 MB
Created
Weekly downloads
 

Readme

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

Last updated on 01 Jun 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc