find-up-json
Find, read and parse the first matching file found walking the filesystem upwards.
Last updated a year ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install find-up-json 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.5                                ...           latest (a year ago)

8 Versions

  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |