# yo-fs

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

Latest version **3.0.3** (published 2017-06-01) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install yo-fs
pnpm add yo-fs
yarn add yo-fs
bun add yo-fs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2017-06-01 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | karissa mckelvey |
| Maintainers | juliangruber, karissa, laurengarcia |
| Keywords | file, system, directories, yo-yo, yo, ui, web, browser, client |

## Links

- npm: https://www.npmjs.com/package/yo-fs
- Repository: https://github.com/karissa/yo-fs
- Homepage: https://github.com/karissa/yo-fs#readme
- Issues: https://github.com/karissa/yo-fs/issues
- npm.io page: https://npm.io/package/yo-fs

## Dependencies (4)

- [yo-yo](https://npm.io/package/yo-yo.md) ^1.2.1
- [render-data](https://npm.io/package/render-data.md) ^2.1.0
- [relative-date](https://npm.io/package/relative-date.md) ^1.1.3
- [prettier-bytes](https://npm.io/package/prettier-bytes.md) ^1.0.3

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2017-06-01
- 3.0.2 — 2017-04-14
- 3.0.1 — 2016-09-28
- 3.0.0 — 2016-09-06
- 2.0.6 — 2016-08-16
- 2.0.5 — 2016-07-19
- 2.0.4 — 2016-07-14
- 2.0.3 — 2016-07-12
- 2.0.2 — 2016-06-16
- 2.0.1 — 2016-06-14
- 2.0.0 — 2016-06-14
- 1.0.5 — 2016-06-07
- 1.0.4 — 2016-06-06
- 1.0.3 — 2016-06-03
- 1.0.2 — 2016-06-03
- … 2 more at https://npm.io/package/yo-fs/versions

## README

# yo-fs

A client-side modular, stream-friendly ui browser widget for navigating directories, built with [yo-yo](npmjs.org/yo-yo).

[![NPM](https://nodei.co/npm/yo-fs.png)](https://nodei.co/npm/yo-fs/)

## 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

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

---
_Source: https://npm.io/package/yo-fs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
