Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-15051

add support for application/vnd.npm.install-v1+json abbreviated npm install package metadata in repository manager version 3

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:

      Description

      NPM specifies an abbreviated metadata format which is requested when the client sets a header, for packages with many versions the metadata can grow quite large.

      npm cli version 4.5.0 introduced a more optimized npm package metadata response payload.

      If the server receives a special header, Accept: application/vnd.npm.install-v1+json the server ( Nexus ) can optionally return a smaller package metadata response to the client.

      The npm client internal to Nexus which fetches remote metadata on behalf of a proxy repository may also be able to utilize this as well when requesting package metadata from a remote. TBD.

      https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
      https://github.com/npm/npm/releases/tag/v4.5.0
      https://blog.packagecloud.io/eng/2018/01/24/npm-registry-internals/
      https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format

      Notice the size of package metadata is greatly reduced by sending this header:

      > curl -sI https://registry.npmjs.org/npm -H "Accept: application/vnd.npm.install-v1+json" | grep -i Content-Length
      Content-Length: 929070
      
      > curl -sI https://registry.npmjs.org/npm | grep -i Content-Length
      Content-Length: 8099623
      

      Expected

      1. Outbound NPM proxy repo requests support asking remotes for abbreviated metadata
      2. Inbound NPM repo requests support responding with abbreviated metadata if asked for it

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mpiggott Matthew Piggott
              Last Updated By:
              Joe Tom Joe Tom
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title