Find the path of the first file matching a given name, walking the filesystem upwards.
npm install --save find-up-path
import findUpPath from 'find-up-path';
const packagePath = findUpPath ( 'package.json' ); // => '/path/to/package.json' | undefined
MIT © Fabio Spampinato