Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Name can't start with underscore #18

Closed
wants to merge 1 commit into from

3 participants

@julianduque

According to https://npmjs.org/doc/json.html

The name ends up being part of a URL, an argument on the command line, 
and a folder name. Any name with non-url-safe characters will be rejected. 
Also, it can't start with a dot or an underscore.
@julianduque julianduque [fix] name can't start with underscore (_)
According to https://npmjs.org/doc/json.html : ...Also, it can't start with a
dot or an underscore.
c7968b6
@rlidwka

it also can't start with - by the way, npm allows it, but it's rejected by couchdb

@isaacs
Owner

Handled by normalize-package-data now.

@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 19, 2013
  1. @julianduque

    [fix] name can't start with underscore (_)

    julianduque authored
    According to https://npmjs.org/doc/json.html : ...Also, it can't start with a
    dot or an underscore.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  read-json.js
View
1  read-json.js
@@ -560,6 +560,7 @@ function validName (file, data) {
}
data.name = data.name.trim()
if (data.name.charAt(0) === "." ||
+ data.name.charAt(0) === "_" ||
data.name.match(/[\/@\s\+%:]/) ||
data.name !== encodeURIComponent(data.name) ||
data.name.toLowerCase() === "node_modules" ||
Something went wrong with that request. Please try again.