Skip to content

dmi3y/searchup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

searchup Build Status

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published