@saulx/get-package

1.0.7 • Public • Published

get-package

Get the nearest package.json

Default

import getPkg from 'get-package'

getPkg('from-some-path').then(pkg => {
  console.log(pkg)
})

// Not passing a path defaults to process.cwd()
getPkg().then(pkg => {
  console.log(pkg)
})

getPackagePath

import { getPackagePath } from 'get-package'
getPackagePath('from-some-path').then(dirPath => {
  // package.json directory path
  console.log(dirPath)
})

Readme

Keywords

none

Package Sidebar

Install

npm i @saulx/get-package

Weekly Downloads

10

Version

1.0.7

License

none

Unpacked Size

4.24 kB

Total Files

4

Last publish

Collaborators

  • saulx