Skip to content

[DOCS] Documentation for package-lock.json is missing os, cpu, and funding fields. #5849

Description

@mykongee

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Enhancement, not another kind of Docs Enhancement.

  • This is a CLI Docs Enhancement.

Description of Problem

When I open up a package-lock.json file (in this case, in a vanilla project that is generated through npm init vite), I can see that the packages object contains a number of other objects each with similar fields like version, integrity, etc. Sure enough, these fields are reflected in the documentation here. I have encountered a few fields that don't seem to be reflected in the docs, namely: os, cpu, and funding (understandably, these seem optional so may not warrant documenting in the first place, though I think it would be nice if there was a note on that 🙂).

Here is one example of node_modules/esbuild-windows-64 with the cpu and os fields:

    "node_modules/esbuild-windows-64": {
      "version": "0.14.54",
      "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz",
      "integrity": "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "optional": true,
      "os": [
        "win32"
      ],
      "engines": {
        "node": ">=12"
      }
    },

I was wondering if there were a particular reason these fields are not present in the documentation, and was hoping someone could correct me if I was misunderstanding something. Thank you!

Potential Solution

A potential enhancement would involve editing the packages section of package-lock-json.md to include these fields, along with a short description of each.

Docs URL

https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json#packages

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions