npm
===

.. py:module:: npm


Attributes
----------

.. autoapisummary::

   npm.logger


Classes
-------

.. autoapisummary::

   npm.NPMLink
   npm.NPMLinksParser
   npm.NPM


Module Contents
---------------

.. py:data:: logger

.. py:class:: NPMLink(name: str, version: str, url: str, checksum: str)

   .. py:attribute:: filename


   .. py:attribute:: package_name


   .. py:attribute:: version


   .. py:attribute:: url


   .. py:attribute:: checksum


.. py:class:: NPMLinksParser

   .. py:attribute:: links
      :type:  list[NPMLink]
      :value: []



   .. py:method:: _raise_missing_key(key: str) -> None


   .. py:method:: feed(data: str) -> NPMLinksParser

      Feed this parser with retrieved JSON data.

      .. seealso: :meth:`html.parser.HTMLParser.feed`



.. py:class:: NPM(url: str = 'https://registry.npmjs.org/')

   .. py:attribute:: url
      :value: 'https://registry.npmjs.org/'



   .. py:attribute:: cache
      :type:  dict[str, list[NPMLink]]


   .. py:method:: fetch_project_links(name: str, *, headers: dict[str, str | bytes | None] | None = None) -> list[NPMLink]

      Fetch list of resources for a given NPM package.

      :param name: NPM package name
      :param headers: To add additionnal headers to the HTTP request. Can be mandatory
          depending on the situation.
      :return: a list of dict containing the link to each resource along with
          some metadata



