yalookup
v0.1.4
Published
yet another lookup
Downloads
2,055
Readme
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
string
plain text name of the file, no support for glob - options
object
currently only supports a single option:- cwd
string
the directory to start searching upwards from, defaults toprocess.cwd()
- cwd
- return
string
the filepath of the file if found,null
otherwise
status
license
(C) Copyright 2015, bzb-stcnx, all rights reserved. MIT