0.1.4 • Published 10 years ago
yalookup v0.1.4
yalookup
yet another lookup! look for a file searching from the current or a given directory up.
motivation
very lean recursive implementation restricted to using only node's core modules.
- no glob
- only one option (cwd)
- only synchronous
- no cli
at least for now.
usage
example
search from __dirname upwards for package.json:
var lookup = require('yalookup')
var filepath = lookup('package.json', { cwd: __dirname })signature
lookup(filename: string, options: object): string
- filename
stringplain text name of the file, no support for glob - options
objectcurrently only supports a single option:- cwd
stringthe directory to start searching upwards from, defaults toprocess.cwd()
- cwd
- return
stringthe filepath of the file if found,nullotherwise
status
license
(C) Copyright 2015, bzb-stcnx, all rights reserved. MIT

