0.0.1 • Published 10 years ago

searchup v0.0.1

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

searchup

Searching file from current working directory up until root or user home directory.

How to use

npm install searchup

var
    up = require('searchup'),
    path;

function checkPath(path) {

    if ( path ) {

        console.log('File was found at: ' + path);
    } else {

        console.log('Nothing has been found. Keep digging.');
    }
}

up.search('file.txt', function(path) {

    checkPath(path);
});

path = up.searchSync('file.txt');
checkPath(path);

Enter parameter the filename string, the output is full resolved path as a string or null if nothing was found.