find-and-read-package-json
Find and read data from a package.json
file.
Installation
npm install --save find-and-read-package-json
Usage
; ;
API
: Promise<file: string; json: any>
Find and read data from a package.json
file that exists in the provided directory, or that exists in a parent
directory of the provided directory.
Parameters
directory
:string
- Required. The directory we will start looking for apackage.json
file in.options
cache
:{[file: string]: any}
- Optional. An object shared between calls tofindAndReadPackageJSON()
to reduce repeated calls tofs .readFile()
.transform
:(json : any) => any
Optional. A function to transform the JSON read from apackage.json
file (to save large chunks of JSON from being cached).