to-read-package
v1.5.5
Published
Read a package.json content
Downloads
897
Maintainers
Readme
Getting Started
npm install to-read-package
Usage
readPackage(fileName?, options?): JSON | undefined
import readPackage from 'to-read-package'
const pkg = readPackage()
// { "name": "root", ... }
const pkg = readPackage('./fewjiogw/wiefoiwe')
// undefined
const pkg = readPackage(undefined, { cwd: path.resolve('./packages/a') })
// { "name": "a", ... }
Options
{
cwd: process.cwd()
}