Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
libnpmaccess
Advanced tools
Readme
libnpmaccess
is a Node.js
library that provides programmatic access to the guts of the npm CLI's npm access
command. This includes managing account mfa settings, listing
packages and permissions, looking at package collaborators, and defining
package permissions for users, orgs, and teams.
const access = require('libnpmaccess')
const opts = { '//registry.npmjs.org/:_authToken: 'npm_token }
// List all packages @zkat has access to on the npm registry.
console.log(Object.keys(await access.getPackages('zkat', opts)))
opts
for all libnpmaccess
commandslibnpmaccess
uses npm-registry-fetch
.
All options are passed through directly to that library, so please refer
to its own opts
documentation
for options that can be passed in.
spec
parameter for all libnpmaccess
commandsspec
must be an npm-package-arg
-compatible
registry spec.
access.getCollaborators(spec, opts) -> Promise<Object>
Gets collaborators for a given package
access.getPackages(user|scope|team, opts) -> Promise<Object>
Gets all packages for a given user, scope, or team.
Teams should be in the format scope:team
or @scope:team
Users and scopes can be in the format @scope
or scope
access.getVisibility(spec, opts) -> Promise<Object>
Gets the visibility of a given package
access.removePermissions(team, spec, opts) -> Promise<Boolean>
Removes the access for a given team to a package.
Teams should be in the format scope:team
or @scope:team
access.setAccess(package, access, opts) -> Promise<Boolean>
Sets access level for package described by spec
.
The npm registry accepts the following access
levels:
public
: package is public
private
: package is private
The npm registry also only allows scoped packages to have their access level set.
Sets the publishing mfa requirements for a given package. Level must be one of the following
none
: mfa is not required to publish this package.
publish
: mfa is required to publish this package, automation tokens
cannot be used to publish.
automation
: mfa is required to publish this package, automation tokens
may also be used for publishing from continuous integration workflows.
Sets permissions levels for a given team to a package.
Teams should be in the format scope:team
or @scope:team
The npm registry accepts the following permissions
:
read-only
: Read only permissions
read-write
: Read and write (aka publish) permissions
FAQs
programmatic library for `npm access` commands
The npm package libnpmaccess receives a total of 1,279,471 weekly downloads. As such, libnpmaccess popularity was classified as popular.
We found that libnpmaccess demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.