Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
doc: add package name restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
linclark authored and othiym23 committed May 1, 2015
1 parent d975aa0 commit ca478dc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions doc/files/package.json.md
Expand Up @@ -17,14 +17,23 @@ them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.

The name is what your thing is called. Some tips:
The name is what your thing is called.

Some rules:

* The name must be shorter than 214 characters. This includes the scope for
scoped packages.
* The name can't start with a dot or an underscore.
* New packages must not have uppercase letters in the name.
* The name ends up being part of a URL, an argument on the command line, and a
folder name. Therefore, the name can't contain any non-URL-safe characters.

Some tips:

* Don't use the same name as a core Node module.
* Don't put "js" or "node" in the name. It's assumed that it's js, since you're
writing a package.json file, and you can specify the engine using the "engines"
field. (See below.)
* 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.
* The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive.
* You may want to check the npm registry to see if there's something by that name
Expand Down

0 comments on commit ca478dc

Please sign in to comment.