npm-access.1 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. .TH "NPM\-ACCESS" "1" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-access\fR \- Set access level on published packages
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm access public [<package>]
  9. npm access restricted [<package>]
  10. npm access grant <read\-only|read\-write> <scope:team> [<package>]
  11. npm access revoke <scope:team> [<package>]
  12. npm access 2fa\-required [<package>]
  13. npm access 2fa\-not\-required [<package>]
  14. npm access ls\-packages [<user>|<scope>|<scope:team>]
  15. npm access ls\-collaborators [<package> [<user>]]
  16. npm access edit [<package>]
  17. .fi
  18. .RE
  19. .SS Description
  20. .P
  21. Used to set access controls on private packages\.
  22. .P
  23. For all of the subcommands, \fBnpm access\fP will perform actions on the packages
  24. in the current working directory if no package name is passed to the
  25. subcommand\.
  26. .RS 0
  27. .IP \(bu 2
  28. public / restricted:
  29. Set a package to be either publicly accessible or restricted\.
  30. .IP \(bu 2
  31. grant / revoke:
  32. Add or remove the ability of users and teams to have read\-only or read\-write
  33. access to a package\.
  34. .IP \(bu 2
  35. 2fa\-required / 2fa\-not\-required:
  36. Configure whether a package requires that anyone publishing it have two\-factor
  37. authentication enabled on their account\.
  38. .IP \(bu 2
  39. ls\-packages:
  40. Show all of the packages a user or a team is able to access, along with the
  41. access level, except for read\-only public packages (it won't print the whole
  42. registry listing)
  43. .IP \(bu 2
  44. ls\-collaborators:
  45. Show all of the access privileges for a package\. Will only show permissions
  46. for packages to which you have at least read access\. If \fB<user>\fP is passed in,
  47. the list is filtered only to teams \fIthat\fR user happens to belong to\.
  48. .IP \(bu 2
  49. edit:
  50. Set the access privileges for a package at once using \fB$EDITOR\fP\|\.
  51. .RE
  52. .SS Details
  53. .P
  54. \fBnpm access\fP always operates directly on the current registry, configurable
  55. from the command line using \fB\-\-registry=<registry url>\fP\|\.
  56. .P
  57. Unscoped packages are \fIalways public\fR\|\.
  58. .P
  59. Scoped packages \fIdefault to restricted\fR, but you can either publish them as
  60. public using \fBnpm publish \-\-access=public\fP, or set their access as public using
  61. \fBnpm access public\fP after the initial publish\.
  62. .P
  63. You must have privileges to set the access of a package:
  64. .RS 0
  65. .IP \(bu 2
  66. You are an owner of an unscoped or scoped package\.
  67. .IP \(bu 2
  68. You are a member of the team that owns a scope\.
  69. .IP \(bu 2
  70. You have been given read\-write privileges for a package, either as a member
  71. of a team or directly as an owner\.
  72. .RE
  73. .P
  74. If you have two\-factor authentication enabled then you'll have to pass in an
  75. otp with \fB\-\-otp\fP when making access changes\.
  76. .P
  77. If your account is not paid, then attempts to publish scoped packages will fail
  78. with an HTTP 402 status code (logically enough), unless you use
  79. \fB\-\-access=public\fP\|\.
  80. .P
  81. Management of teams and team memberships is done with the \fBnpm team\fP command\.
  82. .SS See Also
  83. .RS 0
  84. .IP \(bu 2
  85. \fBlibnpmaccess\fP \fIhttps://npm\.im/libnpmaccess\fR
  86. .IP \(bu 2
  87. npm help team
  88. .IP \(bu 2
  89. npm help publish
  90. .IP \(bu 2
  91. npm help config
  92. .IP \(bu 2
  93. npm help registry
  94. .RE