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

Travis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Travis

Recursively traverses a directory, exposing the structure through events.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Travis

A recursive directory traverser that aims to make handling complex folder structures extremely easy.

Install

$ npm install Travis

Test

The tests are written using Mocha and Should, and can be run with npm test.

Use

Usage is quite simple. All you have to do is new Travis(path), listen for various events on it, and travis.scan().

Please note that this does not ignore files like .DS_Store, thumbs.db, or any other system/dot/hidden files. If you don't want them, ignore them yourself, you lazy bum.

Example

var Travis = require('Travis');

var travis = new Travis('./folder/');

travis.on('directory', function (path, dir) {
	console.log('Directory!', path, dir);
});

travis.on('file', function (dir, name) {
	console.log('File!', dir, name);
});

travis.on('end', function () {
	console.log('DONE!');
});
travis.scan();

Events

directory

Emitted for each directory the traverser finds.

Recieves the path of the containing directory and the name of this directory.

file

Emitted for each file the traverser finds.

Recieves the path of the containing directory and the name of the file.

end

Emitted when the entire structure has been traversed.

error

Emitted when something breaks.

Recieves the error.

Issues?

If this isn't your issue, file a bug report. If you're not lazy, file a pull request too.

You can also find me on Freenode IRC as Nuck, just ping me in #Node.js and I'll try to help you out.

FAQs

Package last updated on 23 Feb 2012

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