{"name":"read-package-tree","version":"5.2.2","author":{"url":"http://blog.izs.me/","name":"Isaac Z. Schlueter","email":"i@izs.me"},"license":"ISC","_id":"read-package-tree@5.2.2","maintainers":[{"name":"iarna","email":"me@re-becca.org"},{"name":"isaacs","email":"i@izs.me"},{"name":"zkat","email":"npm@zkat.tech"}],"homepage":"https://github.com/npm/read-package-tree","bugs":{"url":"https://github.com/npm/read-package-tree/issues"},"dist":{"shasum":"4b6a0ef2d943c1ea36a578214c9a7f6b7424f7a8","tarball":"http://registry-npm.ywwl.com/read-package-tree/download/read-package-tree-5.2.2.tgz","fileCount":4,"integrity":"sha512-rW3XWUUkhdKmN2JKB4FL563YAgtINifso5KShykufR03nJ5loGFlkUMe1g/yxmqX073SoYYTsgXu7XdDinKZuA==","signatures":[{"sig":"MEYCIQDcmZuaTOW49J0gpYc0UeyCBn+2SzQwNKxo5SRawlGRdAIhAP4v8g+4jvYf6Hj4sNoS2BHUB5qaQ33LrWzkKxmiopXi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY1NYCRA9TVsSAnZWagAAK6sP/34gyGlr2T1TXQedFQzf\nX6f4eXcQ+ZphUIvVz+fEs8XjzVff528cH8hM8Y0xazIoRabveMrlpd+Nl+cn\nUOwIEsK34R8Igu6ZvbfC7JaebINdv0Q0/9ynAbuNARwshFi4va0i08b1aiok\nrwaPEbZJiBeLAXn9BSVB1Oc9iW3qcl9c/AcXg72szahB2vEB9LE4dqKUKEA2\ng6NZs/rSTNwvvnQRXqrJrNePX7gHb75K0CzI6XSkp6SPrC2v+vnl5B25tHWm\nTlZFYCa4GHkT6eOvqqnu9x6m4G8dcrl8K0JL2h6rAou/g348zqKyP6njCrhs\nYORhb9EEf1GnSt/YeEF3jwW81D0sWCmXIviVPGSiJsdUI8cfpwWm5/htNw5u\nS7xkrTydHE9IJXTqUjGXMGJJpxvfG2ky3AVtKawfwhJVvpnieXrI5TGVYw6g\nLHABi/SlU0OH7AqM3IIrdInxolnke8LQIVPs1Vb9aPBBB6IBtxXXtDxVA33z\nojBeW5jxwuz1xfAHBWoShJsP/O2EHFEw51AHhydhkxlobrvVOH2xmcwy1rcf\nO728Uy5k4Cvwh8oAlKkZhosgVq3HjZpNz/eVOzfdGoXzExkpFQbePukFt4XC\n6eRA03AzQcwRmsuEwNsl3XWJAMgOKHBWOASAZGhN3842xErhoE/bbzOXQi5N\nudLT\r\n=ISUz\r\n-----END PGP SIGNATURE-----\r\n","size":4084,"noattachment":false,"key":"/read-package-tree/-/read-package-tree-5.2.2.tgz"},"main":"rpt.js","gitHead":"ee595cb0d318e07ffaeb52f6dc4d84cf92f7cbf9","scripts":{"test":"tap test/*.js"},"_npmUser":{"name":"zkat","email":"npm@zkat.tech"},"deprecated":"The functionality that this package provided is now in @npmcli/arborist","repository":{"url":"git+https://github.com/npm/read-package-tree.git","type":"git"},"_npmVersion":"6.8.0-next.2","description":"Read the contents of node_modules.","directories":{"test":"test"},"_nodeVersion":"11.6.0","dependencies":{"once":"^1.3.0","dezalgo":"^1.0.0","debuglog":"^1.0.1","read-package-json":"^2.0.0","readdir-scoped-modules":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^12.5.2","archy":"^1.0.0","tacks":"^1.2.1","mkdirp":"^0.5.1"},"_npmOperationalInternal":{"tmp":"tmp/read-package-tree_5.2.2_1550013272124_0.7247364228167252","host":"s3://npm-registry-packages"},"readme":"# read-package-tree\n\n[![Build Status](https://travis-ci.org/npm/read-package-tree.svg?branch=master)](https://travis-ci.org/npm/read-package-tree)\n\nRead the contents of node_modules.\n\n## USAGE\n\n```javascript\nvar rpt = require ('read-package-tree')\nrpt('/path/to/pkg/root', function (node, kidName) {\n  // optional filter function– if included, each package folder found is passed to\n  // it to see if it should be included in the final tree\n  // node is what we're adding children to\n  // kidName is the directory name of the module we're considering adding\n  // return true -> include, false -> skip\n}, function (er, data) {\n  // er means that something didn't work.\n  // data is a structure like:\n  // {\n  //   package: <package.json data, or an empty object>\n  //   package.name: defaults to `basename(path)`\n  //   children: [ <more things like this> ]\n  //   parent: <thing that has this in its children property, or null>\n  //   path: <path loaded>\n  //   realpath: <the real path on disk>\n  //   isLink: <set if this is a Link>\n  //   target: <if a Link, then this is the actual Node>\n  //   error: <if set, the error we got loading/parsing the package.json>\n  // }\n})\n\n// or promise-style\nrpt('/path/to/pkg/root').then(data => { ... })\n```\n\nThat's it.  It doesn't figure out if dependencies are met, it doesn't\nmutate package.json data objects (beyond what\n[read-package-json](http://npm.im/read-package-json) already does), it\ndoesn't limit its search to include/exclude `devDependencies`, or\nanything else.\n\nJust follows the links in the `node_modules` hierarchy and reads the\npackage.json files it finds therein.\n\n## Symbolic Links\n\nWhen there are symlinks to packages in the `node_modules` hierarchy, a\n`Link` object will be created, with a `target` that is a `Node`\nobject.\n\nFor the most part, you can treat `Link` objects just the same as\n`Node` objects.  But if your tree-walking program needs to treat\nsymlinks differently from normal folders, then make sure to check the\nobject.\n\nIn a given `read-package-tree` run, a specific `path` will always\ncorrespond to a single object, and a specific `realpath` will always\ncorrespond to a single `Node` object.  This means that you may not be\nable to pass the resulting data object to `JSON.stringify`, because it\nmay contain cycles.\n\n## Errors\n\nErrors parsing or finding a package.json in node_modules will result in a\nnode with the error property set.  We will still find deeper node_modules\nif any exist. *Prior to `5.0.0` these aborted tree reading with an error\ncallback.*\n\nOnly a few classes of errors are fatal (result in an error callback):\n\n* If the top level location is entirely missing, that will error.\n* if `fs.realpath` returns an error for any path its trying to resolve.\n","publish_time":1550013272343,"_cnpm_publish_time":1550013272343,"dist-tags":{"latest":"5.3.1"}}