summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/read-package-tree
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/node_modules/read-package-tree')
-rw-r--r--deps/node/deps/npm/node_modules/read-package-tree/LICENSE15
-rw-r--r--deps/node/deps/npm/node_modules/read-package-tree/README.md68
-rw-r--r--deps/node/deps/npm/node_modules/read-package-tree/package.json70
-rw-r--r--deps/node/deps/npm/node_modules/read-package-tree/rpt.js250
4 files changed, 0 insertions, 403 deletions
diff --git a/deps/node/deps/npm/node_modules/read-package-tree/LICENSE b/deps/node/deps/npm/node_modules/read-package-tree/LICENSE
deleted file mode 100644
index 19129e31..00000000
--- a/deps/node/deps/npm/node_modules/read-package-tree/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/node/deps/npm/node_modules/read-package-tree/README.md b/deps/node/deps/npm/node_modules/read-package-tree/README.md
deleted file mode 100644
index d2248f82..00000000
--- a/deps/node/deps/npm/node_modules/read-package-tree/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# read-package-tree
-
-Read the contents of node_modules.
-
-## USAGE
-
-```javascript
-var rpt = require ('read-package-tree')
-rpt('/path/to/pkg/root', function (node, kidName) {
- // optional filter function– if included, each package folder found is passed to
- // it to see if it should be included in the final tree
- // node is what we're adding children to
- // kidName is the directory name of the module we're considering adding
- // return true -> include, false -> skip
-}, function (er, data) {
- // er means that something didn't work.
- // data is a structure like:
- // {
- // package: <package.json data, or an empty object>
- // package.name: defaults to `basename(path)`
- // children: [ <more things like this> ]
- // parent: <thing that has this in its children property, or null>
- // path: <path loaded>
- // realpath: <the real path on disk>
- // isLink: <set if this is a Link>
- // target: <if a Link, then this is the actual Node>
- // error: <if set, the error we got loading/parsing the package.json>
- // }
-})
-```
-
-That's it. It doesn't figure out if dependencies are met, it doesn't
-mutate package.json data objects (beyond what
-[read-package-json](http://npm.im/read-package-json) already does), it
-doesn't limit its search to include/exclude `devDependencies`, or
-anything else.
-
-Just follows the links in the `node_modules` hierarchy and reads the
-package.json files it finds therein.
-
-## Symbolic Links
-
-When there are symlinks to packages in the `node_modules` hierarchy, a
-`Link` object will be created, with a `target` that is a `Node`
-object.
-
-For the most part, you can treat `Link` objects just the same as
-`Node` objects. But if your tree-walking program needs to treat
-symlinks differently from normal folders, then make sure to check the
-object.
-
-In a given `read-package-tree` run, a specific `path` will always
-correspond to a single object, and a specific `realpath` will always
-correspond to a single `Node` object. This means that you may not be
-able to pass the resulting data object to `JSON.stringify`, because it
-may contain cycles.
-
-## Errors
-
-Errors parsing or finding a package.json in node_modules will result in a
-node with the error property set. We will still find deeper node_modules
-if any exist. *Prior to `5.0.0` these aborted tree reading with an error
-callback.*
-
-Only a few classes of errors are fatal (result in an error callback):
-
-* If the top level location is entirely missing, that will error.
-* if `fs.realpath` returns an error for any path its trying to resolve.
diff --git a/deps/node/deps/npm/node_modules/read-package-tree/package.json b/deps/node/deps/npm/node_modules/read-package-tree/package.json
deleted file mode 100644
index bb7295da..00000000
--- a/deps/node/deps/npm/node_modules/read-package-tree/package.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "_args": [
- [
- "read-package-tree@5.2.1",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "read-package-tree@5.2.1",
- "_id": "read-package-tree@5.2.1",
- "_inBundle": false,
- "_integrity": "sha512-2CNoRoh95LxY47LvqrehIAfUVda2JbuFE/HaGYs42bNrGG+ojbw1h3zOcPcQ+1GQ3+rkzNndZn85u1XyZ3UsIA==",
- "_location": "/read-package-tree",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "read-package-tree@5.2.1",
- "name": "read-package-tree",
- "escapedName": "read-package-tree",
- "rawSpec": "5.2.1",
- "saveSpec": null,
- "fetchSpec": "5.2.1"
- },
- "_requiredBy": [
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.2.1.tgz",
- "_spec": "5.2.1",
- "_where": "/Users/rebecca/code/npm",
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "bugs": {
- "url": "https://github.com/npm/read-package-tree/issues"
- },
- "dependencies": {
- "debuglog": "^1.0.1",
- "dezalgo": "^1.0.0",
- "once": "^1.3.0",
- "read-package-json": "^2.0.0",
- "readdir-scoped-modules": "^1.0.0"
- },
- "description": "Read the contents of node_modules.",
- "devDependencies": {
- "archy": "^1.0.0",
- "mkdirp": "^0.5.1",
- "tacks": "^1.2.1",
- "tap": "^6.3.0"
- },
- "directories": {
- "test": "test"
- },
- "files": [
- "rpt.js"
- ],
- "homepage": "https://github.com/npm/read-package-tree",
- "license": "ISC",
- "main": "rpt.js",
- "name": "read-package-tree",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/npm/read-package-tree.git"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "version": "5.2.1"
-}
diff --git a/deps/node/deps/npm/node_modules/read-package-tree/rpt.js b/deps/node/deps/npm/node_modules/read-package-tree/rpt.js
deleted file mode 100644
index c577ea18..00000000
--- a/deps/node/deps/npm/node_modules/read-package-tree/rpt.js
+++ /dev/null
@@ -1,250 +0,0 @@
-var fs = require('fs')
-var rpj = require('read-package-json')
-var path = require('path')
-var dz = require('dezalgo')
-var once = require('once')
-var readdir = require('readdir-scoped-modules')
-var debug = require('debuglog')('rpt')
-
-function asyncForEach (items, todo, done) {
- var remaining = items.length
- if (remaining === 0) return done()
- var seenErr
- items.forEach(function (item) {
- todo(item, handleComplete)
- })
- function handleComplete (err) {
- if (seenErr) return
- if (err) {
- seenErr = true
- return done(err)
- }
- if (--remaining === 0) done()
- }
-}
-
-function dpath (p) {
- if (!p) return ''
- if (p.indexOf(process.cwd()) === 0) {
- p = p.substr(process.cwd().length + 1)
- }
- return p
-}
-
-module.exports = rpt
-
-rpt.Node = Node
-rpt.Link = Link
-
-var ID = 0
-function Node (pkg, logical, physical, er, cache, fromLink) {
- if (!(this instanceof Node)) {
- return new Node(pkg, logical, physical, er, cache)
- }
-
- var node = cache[physical] || this
- if (fromLink && cache[physical]) return cache[physical]
-
- debug(node.constructor.name, dpath(physical), pkg && pkg._id)
-
- const parent = path.dirname(logical)
- if (parent[0] === '@') {
- node.name = path.basename(parent) + '/' + path.basename(logical)
- } else {
- node.name = path.basename(logical)
- }
- node.path = logical
- node.realpath = physical
- node.error = er
- if (!cache[physical]) {
- node.id = ID++
- node.package = pkg || {}
- node.parent = null
- node.isLink = false
- node.children = []
- }
- return cache[physical] = node
-}
-
-Node.prototype.package = null
-Node.prototype.path = ''
-Node.prototype.realpath = ''
-Node.prototype.children = null
-Node.prototype.error = null
-
-function Link (pkg, logical, physical, realpath, er, cache) {
- if (cache[physical]) return cache[physical]
-
- if (!(this instanceof Link)) {
- return new Link(pkg, logical, physical, realpath, er, cache)
- }
-
- cache[physical] = this
-
- debug(this.constructor.name, dpath(physical), pkg && pkg._id)
-
- const dir = path.dirname(logical)
- const parent = path.dirname(dir)
- if (parent[0] === '@') {
- this.name = path.basename(parent) + '/' + path.basename(dir)
- } else {
- this.name = path.basename(dir)
- }
- this.id = ID++
- this.path = logical
- this.realpath = realpath
- this.package = pkg || {}
- this.parent = null
- this.target = new Node(this.package, logical, realpath, er, cache, true)
- this.isLink = true
- this.children = this.target.children
- this.error = er
-}
-
-Link.prototype = Object.create(Node.prototype, {
- constructor: { value: Link }
-})
-Link.prototype.target = null
-Link.prototype.realpath = ''
-
-function loadNode (logical, physical, cache, cb) {
- debug('loadNode', dpath(logical))
- return fs.realpath(physical, thenReadPackageJson)
-
- var realpath
- function thenReadPackageJson (er, real) {
- if (er) {
- var node = new Node(null, logical, physical, er, cache)
- return cb(null, node)
- }
- debug('realpath l=%j p=%j real=%j', dpath(logical), dpath(physical), dpath(real))
- var pj = path.join(real, 'package.json')
- realpath = real
- return rpj(pj, thenCreateNode)
- }
- function thenCreateNode (er, pkg) {
- pkg = pkg || null
- var node
- if (physical === realpath) {
- node = new Node(pkg, logical, physical, er, cache)
- } else {
- node = new Link(pkg, logical, physical, realpath, er, cache)
- }
-
- cb(null, node)
- }
-}
-
-function loadChildren (node, cache, filterWith, cb) {
- debug('loadChildren', dpath(node.path))
- // needed 'cause we process all kids async-like and errors
- // short circuit, so we have to be sure that after an error
- // the cbs from other kids don't result in calling cb a second
- // (or more) time.
- cb = once(cb)
- var nm = path.join(node.path, 'node_modules')
- var rm
- return fs.realpath(path.join(node.path, 'node_modules'), thenReaddir)
-
- function thenReaddir (er, real_nm) {
- if (er) return cb(null, node)
- rm = real_nm
- readdir(nm, thenLoadKids)
- }
-
- function thenLoadKids (er, kids) {
- // If there are no children, that's fine, just return
- if (er) return cb(null, node)
-
- kids = kids.filter(function (kid) {
- return kid[0] !== '.' && (!filterWith || filterWith(node, kid))
- })
-
- asyncForEach(kids, thenLoadNode, thenSortChildren)
- }
- function thenLoadNode (kid, done) {
- var kidPath = path.join(nm, kid)
- var kidRealPath = path.join(rm, kid)
- loadNode(kidPath, kidRealPath, cache, andAddNode(done))
- }
- function andAddNode (done) {
- return function (er, kid) {
- if (er) return done(er)
- node.children.push(kid)
- kid.parent = node
- done()
- }
- }
- function thenSortChildren (er) {
- sortChildren(node)
- cb(er, node)
- }
-}
-
-function sortChildren (node) {
- node.children = node.children.sort(function (a, b) {
- a = a.package.name ? a.package.name.toLowerCase() : a.path
- b = b.package.name ? b.package.name.toLowerCase() : b.path
- return a > b ? 1 : -1
- })
-}
-
-function loadTree (node, did, cache, filterWith, cb) {
- debug('loadTree', dpath(node.path), !!cache[node.path])
-
- if (did[node.realpath]) {
- return dz(cb)(null, node)
- }
-
- did[node.realpath] = true
-
- // needed 'cause we process all kids async-like and errors
- // short circuit, so we have to be sure that after an error
- // the cbs from other kids don't result in calling cb a second
- // (or more) time.
- cb = once(cb)
- return loadChildren(node, cache, filterWith, thenProcessChildren)
-
- function thenProcessChildren (er, node) {
- if (er) return cb(er)
-
- var kids = node.children.filter(function (kid) {
- return !did[kid.realpath]
- })
-
- return asyncForEach(kids, loadTreeForKid, cb)
- }
- function loadTreeForKid (kid, done) {
- loadTree(kid, did, cache, filterWith, done)
- }
-}
-
-function rpt (root, filterWith, cb) {
- if (!cb) {
- cb = filterWith
- filterWith = null
- }
- var cache = Object.create(null)
- var topErr
- var tree
- return fs.realpath(root, thenLoadNode)
-
- function thenLoadNode (er, realRoot) {
- if (er) return cb(er)
- debug('rpt', dpath(realRoot))
- loadNode(root, realRoot, cache, thenLoadTree)
- }
- function thenLoadTree(er, node) {
- // even if there's an error, it's fine, as long as we got a node
- if (node) {
- topErr = er
- tree = node
- loadTree(node, {}, cache, filterWith, thenHandleErrors)
- } else {
- cb(er)
- }
- }
- function thenHandleErrors (er) {
- cb(topErr && topErr.code !== 'ENOENT' ? topErr : er, tree)
- }
-}