# tree-trav

> A library to handle nested directory structures in Node.js using the EventEmitter API and recursion.

Latest version **1.0.4** (published 2017-09-02) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install tree-trav
pnpm add tree-trav
yarn add tree-trav
bun add tree-trav
```

## 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 | 1.0.4 |
| Published | 2017-09-02 |
| First published | 2017-09-02 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Adam W Patterson |
| Maintainers | awpatterson217 |
| Keywords | recursion, recursive, recursively, tree, tree-trav, trav, node-tree, navigate, node, nodes, file, files, system, folders, folder, directories, directory, nested, nest |

## Links

- npm: https://www.npmjs.com/package/tree-trav
- Repository: https://github.com/Awpatterson217/tree-trav
- Homepage: https://github.com/Awpatterson217/tree-trav#readme
- Issues: https://github.com/Awpatterson217/tree-trav/issues
- npm.io page: https://npm.io/package/tree-trav

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-09-02
- 1.0.3 — 2017-09-02
- 1.0.2 — 2017-09-02
- 1.0.1 — 2017-09-02
- 1.0.0 — 2017-09-02

## README

# tree-trav
A library to handle nested directory structures in Node.js using the <a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter API</a> and recursion. 
<br>
<br>
<a href="https://badge.fury.io/js/tree-trav"><img src="https://badge.fury.io/js/tree-trav.svg" alt="npm version" height="18"></a>
<a href="https://github.com/Awpatterson217/tree-trav/blob/master/LICENSE.MIT"><img src="https://img.shields.io/npm/l/express.svg" alt="npm version" height="18"></a>
<a href="https://github.com/Awpatterson217/tree-trav/blob/master/LICENSE.APACHE2"><img src="https://img.shields.io/hexpm/l/plug.svg" alt="npm version" height="18"></a>
<br>
<hr>
<br>

```js
npm install tree-trav
```

<br>
 <a href="https://github.com/Awpatterson217/tree-trav/blob/master/lib/tree/README.md">
Tree API Documentation
</a>
<br>
<hr>

### Example Usage:

```js
const Tree = require('tree-trav').Tree;
let myTree = new Tree();

let stylesheets = [];
let jsFiles     = [];

// Find all CSS and js files in a 
// nested file structure
myTree.getLeaves('example/root/', [
    '.css',
    '.js'
]);

// Deal with files as they are found
myTree.on('file', (file, dir, extension) =>{
    if(extension === '.js') 
        jsFiles.push(file);

    if(extension === '.css') 
        stylesheets.push(file);
});

```

<br>
Contributors Welcome!

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