# packageroot

> return the closest parent or current directory that contains a package.json

Latest version **1.0.1** (published 2018-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install packageroot
pnpm add packageroot
yarn add packageroot
bun add packageroot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-08-07 |
| First published | 2013-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ryan Day |
| Maintainers | soldair |
| Keywords | packages, root |

## Links

- npm: https://www.npmjs.com/package/packageroot
- Repository: https://github.com/soldair/node-packageroot
- Homepage: https://github.com/soldair/node-packageroot#readme
- Issues: https://github.com/soldair/node-packageroot/issues
- npm.io page: https://npm.io/package/packageroot

## Dependencies (1)

- [parents](https://npm.io/package/parents.md) ~1.0.1

## Recent versions

- 1.0.1 (latest) — 2018-08-07
- 1.0.0 — 2017-09-13
- 0.0.6 — 2017-09-13
- 0.0.5 — 2015-02-24
- 0.0.4 — 2015-02-24
- 0.0.3 — 2015-02-24
- 0.0.2 — 2014-08-04
- 0.0.1 — 2013-12-05
- 0.0.0 — 2013-04-23

## README

[![Build Status](https://secure.travis-ci.org/soldair/node-packageroot.png)](http://travis-ci.org/soldair/node-packageroot)

packageroot
===========

return the closest parent or current directory that contains a package.json


example
=======

```js
var packageroot = require('packageroot');

packageroot('./',function(err,root){
  console.log(root);
  // if im in /root/package/test it would print 
  // /root/package 
});


```

---
_Source: https://npm.io/package/packageroot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
