New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tree-trav

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-trav

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

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

tree-trav

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

npm version npm version npm version


npm install tree-trav

Tree API Documentation

Example Usage:

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


Contributors Welcome!

Keywords

recursion

FAQs

Package last updated on 02 Sep 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