Skip to content

sholladay/pkg-down

Repository files navigation

pkg-down Build status for pkg-down on Circle CI.

Find the topmost package.json file.

Why?

  • Find the end user's project.
  • Useful to find where developer projects might live.
  • Keeps you resilient to filesystem changes.

Install

npm install pkg-down --save

Usage

Get it into your program.

const pkgDown = require('pkg-down');

Find the package.json file closest to the root of the filesystem.

pkgDown().then(filepath => {
    console.log(filepath);  // => '/Users/sholladay/foo/package.json'
});

Contributing

See our contributing guidelines for more details.

  1. Fork it.
  2. Make a feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

MPL-2.0 © Seth Holladay

Go make something, dang it.

About

Find the topmost package.json file

Resources

License

Stars

Watchers

Forks

Packages

No packages published