package-lock-json.5 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. .TH "PACKAGE\-LOCK\.JSON" "5" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBpackage-lock.json\fR \- A manifestation of the manifest
  4. .SS Description
  5. .P
  6. \fBpackage\-lock\.json\fP is automatically generated for any operations where npm
  7. modifies either the \fBnode_modules\fP tree, or \fBpackage\.json\fP\|\. It describes the
  8. exact tree that was generated, such that subsequent installs are able to
  9. generate identical trees, regardless of intermediate dependency updates\.
  10. .P
  11. This file is intended to be committed into source repositories, and serves
  12. various purposes:
  13. .RS 0
  14. .IP \(bu 2
  15. Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies\.
  16. .IP \(bu 2
  17. Provide a facility for users to "time\-travel" to previous states of \fBnode_modules\fP without having to commit the directory itself\.
  18. .IP \(bu 2
  19. To facilitate greater visibility of tree changes through readable source control diffs\.
  20. .IP \(bu 2
  21. And optimize the installation process by allowing npm to skip repeated metadata resolutions for previously\-installed packages\.
  22. .RE
  23. .P
  24. One key detail about \fBpackage\-lock\.json\fP is that it cannot be published, and it
  25. will be ignored if found in any place other than the toplevel package\. It shares
  26. a format with npm help npm\-shrinkwrap\.json, which is essentially the same file, but
  27. allows publication\. This is not recommended unless deploying a CLI tool or
  28. otherwise using the publication process for producing production packages\.
  29. .P
  30. If both \fBpackage\-lock\.json\fP and \fBnpm\-shrinkwrap\.json\fP are present in the root of
  31. a package, \fBpackage\-lock\.json\fP will be completely ignored\.
  32. .SS File Format
  33. .SS name
  34. .P
  35. The name of the package this is a package\-lock for\. This must match what's in
  36. \fBpackage\.json\fP\|\.
  37. .SS version
  38. .P
  39. The version of the package this is a package\-lock for\. This must match what's in
  40. \fBpackage\.json\fP\|\.
  41. .SS lockfileVersion
  42. .P
  43. An integer version, starting at \fB1\fP with the version number of this document
  44. whose semantics were used when generating this \fBpackage\-lock\.json\fP\|\.
  45. .SS packageIntegrity
  46. .P
  47. This is a subresource
  48. integrity \fIhttps://w3c\.github\.io/webappsec/specs/subresourceintegrity/\fR value
  49. created from the \fBpackage\.json\fP\|\. No preprocessing of the \fBpackage\.json\fP should
  50. be done\. Subresource integrity strings can be produced by modules like
  51. \fBssri\fP \fIhttps://www\.npmjs\.com/package/ssri\fR\|\.
  52. .SS preserveSymlinks
  53. .P
  54. Indicates that the install was done with the environment variable
  55. \fBNODE_PRESERVE_SYMLINKS\fP enabled\. The installer should insist that the value of
  56. this property match that environment variable\.
  57. .SS dependencies
  58. .P
  59. A mapping of package name to dependency object\. Dependency objects have the
  60. following properties:
  61. .SS version
  62. .P
  63. This is a specifier that uniquely identifies this package and should be
  64. usable in fetching a new copy of it\.
  65. .RS 0
  66. .IP \(bu 2
  67. bundled dependencies: Regardless of source, this is a version number that is purely for informational purposes\.
  68. .IP \(bu 2
  69. registry sources: This is a version number\. (eg, \fB1\.2\.3\fP)
  70. .IP \(bu 2
  71. git sources: This is a git specifier with resolved committish\. (eg, \fBgit+https://example\.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e\fP)
  72. .IP \(bu 2
  73. http tarball sources: This is the URL of the tarball\. (eg, \fBhttps://example\.com/example\-1\.3\.0\.tgz\fP)
  74. .IP \(bu 2
  75. local tarball sources: This is the file URL of the tarball\. (eg \fBfile:///opt/storage/example\-1\.3\.0\.tgz\fP)
  76. .IP \(bu 2
  77. local link sources: This is the file URL of the link\. (eg \fBfile:libs/our\-module\fP)
  78. .RE
  79. .SS integrity
  80. .P
  81. This is a Standard Subresource
  82. Integrity \fIhttps://w3c\.github\.io/webappsec/specs/subresourceintegrity/\fR for this
  83. resource\.
  84. .RS 0
  85. .IP \(bu 2
  86. For bundled dependencies this is not included, regardless of source\.
  87. .IP \(bu 2
  88. For registry sources, this is the \fBintegrity\fP that the registry provided, or if one wasn't provided the SHA1 in \fBshasum\fP\|\.
  89. .IP \(bu 2
  90. For git sources this is the specific commit hash we cloned from\.
  91. .IP \(bu 2
  92. For remote tarball sources this is an integrity based on a SHA512 of
  93. the file\.
  94. .IP \(bu 2
  95. For local tarball sources: This is an integrity field based on the SHA512 of the file\.
  96. .RE
  97. .SS resolved
  98. .RS 0
  99. .IP \(bu 2
  100. For bundled dependencies this is not included, regardless of source\.
  101. .IP \(bu 2
  102. For registry sources this is path of the tarball relative to the registry
  103. URL\. If the tarball URL isn't on the same server as the registry URL then
  104. this is a complete URL\.
  105. .RE
  106. .SS bundled
  107. .P
  108. If true, this is the bundled dependency and will be installed by the parent
  109. module\. When installing, this module will be extracted from the parent
  110. module during the extract phase, not installed as a separate dependency\.
  111. .SS dev
  112. .P
  113. If true then this dependency is either a development dependency ONLY of the
  114. top level module or a transitive dependency of one\. This is false for
  115. dependencies that are both a development dependency of the top level and a
  116. transitive dependency of a non\-development dependency of the top level\.
  117. .SS optional
  118. .P
  119. If true then this dependency is either an optional dependency ONLY of the
  120. top level module or a transitive dependency of one\. This is false for
  121. dependencies that are both an optional dependency of the top level and a
  122. transitive dependency of a non\-optional dependency of the top level\.
  123. .P
  124. All optional dependencies should be included even if they're uninstallable
  125. on the current platform\.
  126. .SS requires
  127. .P
  128. This is a mapping of module name to version\. This is a list of everything
  129. this module requires, regardless of where it will be installed\. The version
  130. should match via normal matching rules a dependency either in our
  131. \fBdependencies\fP or in a level higher than us\.
  132. .SS dependencies
  133. .P
  134. The dependencies of this dependency, exactly as at the top level\.
  135. .SS See also
  136. .RS 0
  137. .IP \(bu 2
  138. npm help shrinkwrap
  139. .IP \(bu 2
  140. npm help shrinkwrap\.json
  141. .IP \(bu 2
  142. npm help package\-locks
  143. .IP \(bu 2
  144. npm help package\.json
  145. .IP \(bu 2
  146. npm help install
  147. .RE