find-file-recursively-up

1.1.5 • Public • Published

find-file-recursively-up

Build Status Greenkeeper badge

returns the path at which a provided filename exists, checking the current directory and any parent folders recursively up.

Usage

const find = require('find-file-recursively-up');

find('.meta', (err, foundPath) {
  // returns null '/Users/mateodelnorte/development/meta/.meta'
});

Yields undefined if no file found on path to /:

> DEBUG="*" node
 require('find-file-recursively-up')('.metaasdf', console.log)

  loop:find-file-recursively-up looking for .metaasdf at /Users/mateodelnorte/development/meta/plugins/loop-things/.metaasdf +0ms
  loop:find-file-recursively-up looking for .metaasdf at /Users/mateodelnorte/development/meta/plugins/.metaasdf +1ms
  loop:find-file-recursively-up looking for .metaasdf at /Users/mateodelnorte/development/meta/.metaasdf +1ms
  loop:find-file-recursively-up looking for .metaasdf at /Users/mateodelnorte/development/.metaasdf +0ms
  loop:find-file-recursively-up looking for .metaasdf at /Users/mateodelnorte/.metaasdf +0ms
  loop:find-file-recursively-up looking for .metaasdf at /Users/.metaasdf +0ms
  loop:find-file-recursively-up looking for .metaasdf at /.metaasdf +0ms

undefined

/find-file-recursively-up/

    Package Sidebar

    Install

    npm i find-file-recursively-up

    Weekly Downloads

    11

    Version

    1.1.5

    License

    ISC

    Unpacked Size

    6.01 kB

    Total Files

    15

    Last publish

    Collaborators

    • mateodelnorte
    • patrickleet