title: recursively find the closest package.json node.js
body: <p>I am newly with node js, and I would like to find recursively the closest package.json. Actually, continue finding package.json until will not hit it.</p>
  
  <p>My folder tree</p>
  
  <pre><code>root/
    -contarats/
     -proto/
      some.proto
    -package.json 
  
  "script": {
  "contracts": "generate-some-contracts contracts/proto contracts",
  }
  
  const input = process.argv[2]
  const settings = require(path.resolve(input, 'package.json'))
  </code></pre>