uawdijnntqw1x1x1
IP : 216.73.216.86
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
node_modules
/
global-modules
/
..
/
grunt-cli
/
..
/
@types
/
..
/
..
/
4d695
/
libnpmfund.zip
/
/
PK�Z�\q��6ttpackage.jsonnu�[���{ "_id": "libnpmfund@5.0.11", "_inBundle": true, "_location": "/npm/libnpmfund", "_phantomChildren": {}, "_requiredBy": [ "/npm" ], "author": { "name": "GitHub Inc." }, "bugs": { "url": "https://github.com/npm/cli/issues" }, "contributors": [ { "name": "Ruy Adorno", "url": "https://ruyadorno.com" } ], "dependencies": { "@npmcli/arborist": "^7.5.3" }, "description": "Programmatic API for npm fund", "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.22.0", "tap": "^16.3.8" }, "engines": { "node": "^16.14.0 || >=18.0.0" }, "files": [ "bin/", "lib/" ], "homepage": "https://github.com/npm/cli#readme", "keywords": [ "npm", "npmcli", "libnpm", "cli", "git", "fund", "gitfund" ], "license": "ISC", "main": "lib/index.js", "name": "libnpmfund", "repository": { "type": "git", "url": "git+https://github.com/npm/cli.git", "directory": "workspaces/libnpmfund" }, "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "npm run lint -- --fix", "postlint": "template-oss-check", "posttest": "npm run lint", "snap": "tap", "template-oss-apply": "template-oss-apply --force", "test": "tap" }, "tap": { "nyc-arg": [ "--exclude", "tap-snapshots/**" ] }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "version": "4.22.0", "content": "../../scripts/template-oss/index.js" }, "version": "5.0.11" } PK�Z�\�x7biilib/index.jsnu�[���'use strict' const URL = require('node:url').URL const Arborist = require('@npmcli/arborist') // supports object funding and string shorthand, or an array of these // if original was an array, returns an array; else returns the lone item function normalizeFunding (funding) { const normalizeItem = item => typeof item === 'string' ? { url: item } : item const sources = [].concat(funding || []).map(normalizeItem) return Array.isArray(funding) ? sources : sources[0] } // Is the value of a `funding` property of a `package.json` // a valid type+url for `npm fund` to display? function isValidFunding (funding) { if (!funding) { return false } if (Array.isArray(funding)) { return funding.every(f => !Array.isArray(f) && isValidFunding(f)) } try { var parsed = new URL(funding.url || funding) } catch (error) { return false } if ( parsed.protocol !== 'https:' && parsed.protocol !== 'http:' ) { return false } return Boolean(parsed.host) } const empty = () => Object.create(null) function readTree (tree, opts) { let packageWithFundingCount = 0 const seen = new Set() const { countOnly } = opts || {} const _trailingDependencies = Symbol('trailingDependencies') let filterSet if (opts && opts.workspaces && opts.workspaces.length) { const arb = new Arborist(opts) filterSet = arb.workspaceDependencySet(tree, opts.workspaces) } function tracked (name, version) { const key = String(name) + String(version) if (seen.has(key)) { return true } seen.add(key) } function retrieveDependencies (dependencies) { const trailing = dependencies[_trailingDependencies] if (trailing) { return Object.assign( empty(), dependencies, trailing ) } return dependencies } function hasDependencies (dependencies) { return dependencies && ( Object.keys(dependencies).length || dependencies[_trailingDependencies] ) } function attachFundingInfo (target, funding) { if (funding && isValidFunding(funding)) { target.funding = normalizeFunding(funding) packageWithFundingCount++ } } function getFundingDependencies (t) { const edges = t && t.edgesOut && t.edgesOut.values() if (!edges) { return empty() } const directDepsWithFunding = Array.from(edges).map(edge => { if (!edge || !edge.to) { return empty() } const node = edge.to.target || edge.to if (!node.package) { return empty() } if (filterSet && filterSet.size > 0 && !filterSet.has(node)) { return empty() } const { name, funding, version } = node.package // avoids duplicated items within the funding tree if (tracked(name, version)) { return empty() } const fundingItem = {} if (version) { fundingItem.version = version } attachFundingInfo(fundingItem, funding) return { node, fundingItem, } }) return directDepsWithFunding.reduce( (res, { node, fundingItem }) => { if (!fundingItem || fundingItem.length === 0 || !node) { return res } // recurse const transitiveDependencies = node.edgesOut && node.edgesOut.size > 0 && getFundingDependencies(node) // if we're only counting items there's no need // to add all the data to the resulting object if (countOnly) { return null } if (hasDependencies(transitiveDependencies)) { fundingItem.dependencies = retrieveDependencies(transitiveDependencies) } if (isValidFunding(fundingItem.funding)) { res[node.package.name] = fundingItem } else if (hasDependencies(fundingItem.dependencies)) { res[_trailingDependencies] = Object.assign( empty(), res[_trailingDependencies], fundingItem.dependencies ) } return res }, countOnly ? null : empty()) } const treeDependencies = getFundingDependencies(tree) const result = { length: packageWithFundingCount, } if (!countOnly) { const name = (tree && tree.package && tree.package.name) || (tree && tree.name) result.name = name || (tree && tree.path) if (tree && tree.package && tree.package.version) { result.version = tree.package.version } if (tree && tree.package && tree.package.funding) { result.funding = normalizeFunding(tree.package.funding) } result.dependencies = retrieveDependencies(treeDependencies) } return result } async function read (opts) { const arb = new Arborist(opts) const tree = await arb.loadActual(opts) return readTree(tree, opts) } module.exports = { read, readTree, normalizeFunding, isValidFunding, } PK�Z�\�t���LICENSEnu�[���The ISC License Copyright (c) npm Inc. 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. PK�Z�\j��== README.mdnu�[���# libnpmfund [](https://npm.im/libnpmfund) [](https://npm.im/libnpmfund) [](https://github.com/npm/cli/actions/workflows/ci-libnpmfund.yml) [`libnpmfund`](https://github.com/npm/libnpmfund) is a Node.js library for retrieving **funding** information for packages installed using [`arborist`](https://github.com/npm/arborist). ## Table of Contents * [Example](#example) * [Install](#install) * [Contributing](#contributing) * [API](#api) * [LICENSE](#license) ## Example ```js const { read } = require('libnpmfund') const fundingInfo = await read() console.log( JSON.stringify(fundingInfo, null, 2) ) // => { length: 2, name: 'foo', version: '1.0.0', funding: { url: 'https://example.com' }, dependencies: { bar: { version: '1.0.0', funding: { url: 'http://collective.example.com' } } } } ``` ## Install `$ npm install libnpmfund` ### Contributing The npm team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) outlines the process for community interaction and contribution. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. All participants and maintainers in this project are expected to follow the [npm Code of Conduct](https://www.npmjs.com/policies/conduct), and just generally be excellent to each other. Please refer to the [Changelog](CHANGELOG.md) for project history details, too. Happy hacking! ### API ##### <a name="fund.read"></a> `> fund.read([opts]) -> Promise<Object>` Reads **funding** info from a npm install and returns a promise for a tree object that only contains packages in which funding info is defined. Options: - `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over any obj definition and just returns an obj containing `{ length }` - useful for things such as printing a `6 packages are looking for funding` msg. - `workspaces`: `Array<String>` List of workspaces names to filter for, the result will only include a subset of the resulting tree that includes only the nodes that are children of the listed workspaces names. - `path`, `registry` and more [Arborist](https://github.com/npm/arborist/) options. ##### <a name="fund.readTree"></a> `> fund.readTree(tree, [opts]) -> Promise<Object>` Reads **funding** info from a given install tree and returns a tree object that only contains packages in which funding info is defined. - `tree`: An [`arborist`](https://github.com/npm/arborist) tree to be used, e.g: ```js const Arborist = require('@npmcli/arborist') const { readTree } = require('libnpmfund') const arb = new Arborist({ path: process.cwd() }) const tree = await arb.loadActual() return readTree(tree, { countOnly: false }) ``` Options: - `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over any obj definition and just returns an obj containing `{ length }` - useful for things such as printing a `6 packages are looking for funding` msg. ##### <a name="fund.normalizeFunding"></a> `> fund.normalizeFunding(funding) -> Object` From a `funding` `<object|string|array>`, retrieves normalized funding objects containing a `url` property. e.g: ```js normalizeFunding('http://example.com') // => { url: 'http://example.com' } ``` ##### <a name="fund.isValidFunding"></a> `> fund.isValidFunding(funding) -> Boolean` Returns `<true>` if `funding` is a valid funding object, e.g: ```js isValidFunding({ foo: 'not a valid funding obj' }) // => false isValidFunding('http://example.com') // => true ``` ## LICENSE [ISC](./LICENSE) PK�Z�\q��6ttpackage.jsonnu�[���PK�Z�\�x7bii�lib/index.jsnu�[���PK�Z�\�t���ULICENSEnu�[���PK�Z�\j��== nREADME.mdnu�[���PK(�,
/home/emeraadmin/www/node_modules/global-modules/../grunt-cli/../@types/../../4d695/libnpmfund.zip