https://github.com/fabiospampinato/find-up-json
Find, read and parse the first matching file found walking the filesystem upwards.
https://github.com/fabiospampinato/find-up-json
find json parse read up
Last synced: 3 months ago
JSON representation
Find, read and parse the first matching file found walking the filesystem upwards.
- Host: GitHub
- URL: https://github.com/fabiospampinato/find-up-json
- Owner: fabiospampinato
- License: mit
- Created: 2021-05-12T13:41:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T01:54:17.000Z (over 1 year ago)
- Last Synced: 2024-10-31T20:09:07.012Z (12 months ago)
- Topics: find, json, parse, read, up
- Language: TypeScript
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# 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
```sh
npm install find-up-json
```## Usage
```ts
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