Skip to content

Find, read and parse the first matching file found walking the filesystem upwards.

License

Notifications You must be signed in to change notification settings

fabiospampinato/find-up-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find Up JSON

Find, read and parse the first matching file found walking the filesystem upwards.

Compared to alternatives this library is tiny, it has no dependencies, and it can be bundled without problems.

Install

npm install find-up-json

Usage

import findUp from 'find-up-json';

// Let's find the nearest `package.json` file

const pkg = findUp ( 'package.json' );

// =>
// {
//   path: '/path/to/found/package.json',
//   buffer: BufferContentOfFile,
//   content: {
//     // Result of JSON-parsing the content of the file
//     "name": "something..."
//     // ...
//   }
// }

License

MIT © Fabio Spampinato

About

Find, read and parse the first matching file found walking the filesystem upwards.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published