npm

Attributes

logger

Classes

NPMLink

NPMLinksParser

NPM

Module Contents

npm.logger
filename
package_name
version
url
checksum
class npm.NPMLinksParser
_raise_missing_key(key: str) None
feed(data: str) NPMLinksParser

Feed this parser with retrieved JSON data.

class npm.NPM(url: str = 'https://registry.npmjs.org/')
url = 'https://registry.npmjs.org/'
cache: dict[str, list[NPMLink]]

Fetch list of resources for a given NPM package.

Parameters:
  • name – NPM package name

  • headers – To add additionnal headers to the HTTP request. Can be mandatory depending on the situation.

Returns:

a list of dict containing the link to each resource along with some metadata