Skip to content

atelier-saulx/get-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})

Releases

No releases published

Packages

No packages published