{"name":"read-package-tree","version":"5.3.0","author":{"url":"http://blog.izs.me/","name":"Isaac Z. Schlueter","email":"i@izs.me"},"license":"ISC","_id":"read-package-tree@5.3.0","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"},"tap":{"100":true},"dist":{"shasum":"4f95472e45e7145fb77f4069d12844b139f5ea12","tarball":"http://registry-npm.ywwl.com/read-package-tree/download/read-package-tree-5.3.0.tgz","fileCount":5,"integrity":"sha512-Gi64+EWmi4515E1rPR77ae/Ip8cjFQTlsWytSYJj974U0tSnxm67pyXltbDjB1lvLw4dc85HbtidGL1K2c/oxw==","signatures":[{"sig":"MEQCIFhItY+dR7H0imHo/6VNcFSArDJVMdrZVeV3AGCWHw80AiAnMYxnRAVRWOGAgQNixKRVbZ0BBU/ELXqtjq/HRP3lwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13171,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE68iCRA9TVsSAnZWagAA66kP/jU7Tb2Hx6eVQrGlOuZX\nrH6721RFL46kaNXsMi0ur6dmuOr5WO7en26csD88Xmnf4rqtPs5JAUSaPRMN\ni8YFdnauokvNUTmltI0mc5nEO7zwLlHKeSF7o+CjA1id2I+VX3/5o3v/V6CU\n5oupviODQnJwyIpVYhbNMQK9wZKsJ1NDwDvsF2/naNWnQAKUJnbDEXiXS26v\n8Y8tANLc7ALLq+o0YusIejMGtIifgO0g5CYOFh4hZXixvzNRmuMPI/PZ8mvG\n2c1c3r7V7B9yrai19F7hKSEQj5ietUndazesyep/SOl5tHXuIGxBIVZWQ/G6\njFSz2+Q7qdMyRcZgwGzxof2WF0RVFlOA662Wk4sX+Ja8iNCixvc/47P3NIdA\no7h/b4OWnsAeRQ/BngUlG15K3I5jFKNP8NxPmMWgeiVG+1jX0HFLS76x19bj\n0hZJK5ZhyRJr3KcDQFDJ6mQoL4qe3n/IjcFiexDKj9w+lXo9lSp1eE0MhtF1\nklv3DQvT5+FOqq1owAE9JM/G4xsgryOdNFjdcfGhf5CgpjxpSohXqFpeX7lT\nkiCLpY3rGyMfhPaqagZ4BuPjTX8h4RtVzO5gW+Opvlwc197tiySi1v4QXICR\nRd+LbuAvz+ghTVpU7csQFXEIPBB1mGsLHXHQ+kJC0Tqq8C+bAccgimIp2L1s\nwti1\r\n=1Sa4\r\n-----END PGP SIGNATURE-----\r\n","size":5190,"noattachment":false,"key":"/read-package-tree/-/read-package-tree-5.3.0.tgz"},"main":"rpt.js","gitHead":"5534e74abc1aff107ee961086892e1d9f8e65f06","scripts":{"snap":"TAP_SNAPSHOT=1 tap test/*.js --100","test":"tap test/*.js --100","preversion":"npm test","postpublish":"git push origin --follow-tags","postversion":"npm publish"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"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.9.0","description":"Read the contents of node_modules.","directories":{"test":"test"},"_nodeVersion":"12.3.1","dependencies":{"util-promisify":"^2.1.0","read-package-json":"^2.0.0","readdir-scoped-modules":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^12.7.0","archy":"^1.0.0","tacks":"^1.2.1","mkdirp":"^0.5.1"},"_npmOperationalInternal":{"tmp":"tmp/read-package-tree_5.3.0_1561571106047_0.03417640684339718","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":1561571106255,"_cnpm_publish_time":1561571106255,"dist-tags":{"latest":"5.3.1"}}