diff options
author | isaacs <i@izs.me> | 2020-06-04 01:07:00 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-06-04 01:08:48 +0300 |
commit | 1f9cfdac2eda3bd4a3b1427fc450a05811f353fe (patch) | |
tree | f4ceaaad2afb9bd35d8096356421015605002ce3 /node_modules/walk-up-path | |
parent | f1724f457a9e84c7f5c89b6439ef0ab6f482c3c6 (diff) |
update @npmcli/arborist, pacote, cacache
Also some hand-crafted deduping of various deps that got nested as a
result.
Really excited to start self-installing again soon. @npmcli/arborist is
a whole lot smarter about pruning unnecessary duplicate modules in the
normal course of installation.
Diffstat (limited to 'node_modules/walk-up-path')
-rw-r--r-- | node_modules/walk-up-path/LICENSE | 15 | ||||
-rw-r--r-- | node_modules/walk-up-path/README.md | 46 | ||||
-rw-r--r-- | node_modules/walk-up-path/index.js | 11 | ||||
-rw-r--r-- | node_modules/walk-up-path/package.json | 61 |
4 files changed, 133 insertions, 0 deletions
diff --git a/node_modules/walk-up-path/LICENSE b/node_modules/walk-up-path/LICENSE new file mode 100644 index 000000000..05eeeb88c --- /dev/null +++ b/node_modules/walk-up-path/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +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/node_modules/walk-up-path/README.md b/node_modules/walk-up-path/README.md new file mode 100644 index 000000000..6729745f8 --- /dev/null +++ b/node_modules/walk-up-path/README.md @@ -0,0 +1,46 @@ +# walk-up-path + +Given a path string, return a generator that walks up the path, emitting +each dirname. + +So, to get a platform-portable walk up, instead of doing something like +this: + +```js +for (let p = dirname(path); p;) { + + // ... do stuff ... + + const pp = dirname(p) + if (p === pp) + p = null + else + p = pp +} +``` + +Or this: + +```js +for (let p = dirname(path); !isRoot(p); p = dirname(p)) { + // ... do stuff ... +} +``` + +You can do this: + +```js +const walkUpPath = require('walk-up-path') +for (const p of walkUpPath(path)) { + // ... do stuff .. +} +``` + +## API + +```js +const walkUpPath = require('walk-up-path') +``` + +Give the fn a string, it'll yield all the directories walking up to the +root. diff --git a/node_modules/walk-up-path/index.js b/node_modules/walk-up-path/index.js new file mode 100644 index 000000000..05524a6c0 --- /dev/null +++ b/node_modules/walk-up-path/index.js @@ -0,0 +1,11 @@ +const {dirname, resolve} = require('path') +module.exports = function* (path) { + for (path = resolve(path); path;) { + yield path + const pp = dirname(path) + if (pp === path) + path = null + else + path = pp + } +} diff --git a/node_modules/walk-up-path/package.json b/node_modules/walk-up-path/package.json new file mode 100644 index 000000000..0c1da3341 --- /dev/null +++ b/node_modules/walk-up-path/package.json @@ -0,0 +1,61 @@ +{ + "_from": "walk-up-path@^1.0.0", + "_id": "walk-up-path@1.0.0", + "_inBundle": false, + "_integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", + "_location": "/walk-up-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "walk-up-path@^1.0.0", + "name": "walk-up-path", + "escapedName": "walk-up-path", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/@npmcli/arborist" + ], + "_resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", + "_shasum": "d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e", + "_spec": "walk-up-path@^1.0.0", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "https://izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/walk-up-path/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Given a path string, return a generator that walks up the path, emitting each dirname.", + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.7" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/isaacs/walk-up-path#readme", + "license": "ISC", + "name": "walk-up-path", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/walk-up-path.git" + }, + "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "snap": "tap", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "version": "1.0.0" +} |