Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-registry-client

Package Overview
Dependencies
Maintainers
2
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-client - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

lib/access.js

35

index.js

@@ -49,9 +49,32 @@ // utilities for working with the js-registry site.

delete this.config.log
var client = this
fs.readdirSync(join(__dirname, "lib")).forEach(function (f) {
var entry = join(__dirname, "lib", f)
// lib/group-name/operation.js -> client.groupName.operation
var stat = fs.statSync(entry)
if (stat.isDirectory()) {
var groupName = f.replace(/-([a-z])/, dashToCamel)
fs.readdirSync(entry).forEach(function (f) {
if (!f.match(/\.js$/)) return
if (!client[groupName]) {
// keep client.groupName.operation from stomping client.operation
client[groupName] = Object.create(client)
}
var name = f.replace(/\.js$/, "").replace(/-([a-z])/, dashToCamel)
client[groupName][name] = require(join(entry, f))
})
return
}
if (!f.match(/\.js$/)) return
var name = f.replace(/\.js$/, "").replace(/-([a-z])/, dashToCamel)
client[name] = require(entry)
})
}
fs.readdirSync(join(__dirname, "lib")).forEach(function (f) {
if (!f.match(/\.js$/)) return
var name = f.replace(/\.js$/, "")
.replace(/-([a-z])/, function (_, l) { return l.toUpperCase() })
RegClient.prototype[name] = require(join(__dirname, "lib", f))
})
function dashToCamel (_, l) {
return l.toUpperCase()
}

5

lib/tag.js

@@ -12,3 +12,6 @@ module.exports = tag

assert(typeof params.tag === "string", "must pass tag name to tag")
assert(params.auth && typeof params.auth === "object", "must pass auth to tag")
assert(
params.auth && typeof params.auth === "object",
"must pass auth to tag"
)

@@ -15,0 +18,0 @@ var options = {

@@ -5,3 +5,3 @@ {

"description": "Client for the npm registry",
"version": "5.0.0",
"version": "5.1.0",
"repository": {

@@ -20,2 +20,3 @@ "url": "git://github.com/isaacs/npm-registry-client"

"normalize-package-data": "~1.0.1",
"npm-package-arg": "^3.0.0",
"once": "^1.3.0",

@@ -22,0 +23,0 @@ "request": "^2.47.0",

@@ -58,2 +58,15 @@ # npm-registry-client

### client.access(uri, params, cb)
* `uri` {String} Registry URL for the package's access API endpoint.
Looks like `/-/package/<package name>/access`.
* `params` {Object} Object containing per-request properties.
* `access` {String} New access level for the package. Can be either
`public` or `restricted`. Registry will raise an error if trying
to change the access level of an unscoped package.
* `auth` {Credentials}
Set the access level for scoped packages. For now, there are only two
access levels: "public" and "restricted".
### client.adduser(uri, params, cb)

@@ -83,2 +96,63 @@

### client.distTags.fetch(uri, params, cb)
* `uri` {String} Base URL for the registry.
* `params` {Object} Object containing per-request properties.
* `package` {String} Name of the package.
* `auth` {Credentials}
* `cb` {Function}
Fetch all of the `dist-tags` for the named package.
### client.distTags.add(uri, params, cb)
* `uri` {String} Base URL for the registry.
* `params` {Object} Object containing per-request properties.
* `package` {String} Name of the package.
* `distTag` {String} Name of the new `dist-tag`.
* `version` {String} Exact version to be mapped to the `dist-tag`.
* `auth` {Credentials}
* `cb` {Function}
Add (or replace) a single dist-tag onto the named package.
### client.distTags.set(uri, params, cb)
* `uri` {String} Base URL for the registry.
* `params` {Object} Object containing per-request properties.
* `package` {String} Name of the package.
* `distTags` {Object} Object containing a map from tag names to package
versions.
* `auth` {Credentials}
* `cb` {Function}
Set all of the `dist-tags` for the named package at once, creating any
`dist-tags` that do not already exit. Any `dist-tags` not included in the
`distTags` map will be removed.
### client.distTags.update(uri, params, cb)
* `uri` {String} Base URL for the registry.
* `params` {Object} Object containing per-request properties.
* `package` {String} Name of the package.
* `distTags` {Object} Object containing a map from tag names to package
versions.
* `auth` {Credentials}
* `cb` {Function}
Update the values of multiple `dist-tags`, creating any `dist-tags` that do
not already exist. Any pre-existing `dist-tags` not included in the `distTags`
map will be left alone.
### client.distTags.rm(uri, params, cb)
* `uri` {String} Base URL for the registry.
* `params` {Object} Object containing per-request properties.
* `package` {String} Name of the package.
* `distTag` {String} Name of the new `dist-tag`.
* `auth` {Credentials}
* `cb` {Function}
Remove a single `dist-tag` from the named package.
### client.get(uri, params, cb)

@@ -85,0 +159,0 @@

@@ -60,3 +60,3 @@ var test = require("tap").test

{ name : "AssertionError", message : "must pass version to tag" },
"auth must include username"
"tag must include version"
)

@@ -73,3 +73,3 @@

{ name : "AssertionError", message : "must pass tag name to tag" },
"auth must include username"
"tag must include name"
)

@@ -86,3 +86,3 @@

{ name : "AssertionError", message : "must pass auth to tag" },
"auth must include username"
"params must include auth"
)

@@ -89,0 +89,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc