fix(npm-info): correctly encode scoped package names

This adds support for releasing scoped packages that are public and and that have an initial version in the registry available.
More fixes needed to support yet unpublished/private scoped modules.
This commit is contained in:
Stephan Bönnemann 2015-05-12 00:06:03 +02:00
parent 773ecf693f
commit 4821aff69e

View File

@ -5,7 +5,8 @@ var request = require('request')
var efh = require('./error').efh
module.exports = function (pkgName, cb) {
request(process.env.npm_config_registry + pkgName, efh(cb)(function (response, body) {
var encodedPkgName = pkgName.replace(/\//g, '%2F')
request(process.env.npm_config_registry + encodedPkgName, efh(cb)(function (response, body) {
var res = {
version: null,
gitHead: null,