packageroot

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

npm install packageroot
8 downloads in the last day
42 downloads in the last week
142 downloads in the last month

Build Status

packageroot

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

example

var packageroot = require('packageroot');

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