Skip to content

bzb-stcnx/yalookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yalookup

NPM build status js-standard-style

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 to process.cwd()
  • return string the filepath of the file if found, null otherwise

status

stable

license

(C) Copyright 2015, bzb-stcnx, all rights reserved. MIT

About

yet another lookup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published