summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/validate-npm-package-name/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/validate-npm-package-name/README.md')
-rw-r--r--deps/npm/node_modules/validate-npm-package-name/README.md45
1 files changed, 39 insertions, 6 deletions
diff --git a/deps/npm/node_modules/validate-npm-package-name/README.md b/deps/npm/node_modules/validate-npm-package-name/README.md
index 91a963b76..d967fdda2 100644
--- a/deps/npm/node_modules/validate-npm-package-name/README.md
+++ b/deps/npm/node_modules/validate-npm-package-name/README.md
@@ -1,11 +1,44 @@
# validate-npm-package-name
-Give me a string and I'll tell you if it's a valid npm package name.
+Give me a string and I'll tell you if it's a valid `npm` package name.
-This package exports a single synchronous function that takes a string as
-input and returns an object:
+This package exports a single synchronous function that takes a `string` as
+input and returns an object with two properties:
-## Valid Names
+- `validForNewPackages` :: `Boolean`
+- `validForOldPackages` :: `Boolean`
+
+## Contents
+
+- [Naming rules](#naming-rules)
+- [Examples](#examples)
+ + [Valid Names](#valid-names)
+ + [Invalid Names](#invalid-names)
+- [Legacy Names](#legacy-names)
+- [Tests](#tests)
+- [License](#license)
+
+## Naming Rules
+
+Below is a list of rules that valid `npm` package name should conform to.
+
+- package name length should be greater than zero
+- all the characters in the package name must be lowercase i.e., no uppercase or mixed case names are allowed
+- package name *can* consist of hyphens
+- package name must *not* contain any non-url-safe characters (since name ends up being part of a URL)
+- package name should not start with `.` or `_`
+- package name should *not* contain any leading or trailing spaces
+- package name *cannot* be the same as a node.js/io.js core module nor a reserved/blacklisted name. For example, the following names are invalid:
+ + http
+ + stream
+ + node_modules
+ + favicon.ico
+- package name length cannot exceed 214
+
+
+## Examples
+
+### Valid Names
```js
var validate = require("validate-npm-package-name")
@@ -28,10 +61,10 @@ All of the above names are valid, so you'll get this object back:
}
```
-## Invalid Names
+### Invalid Names
```js
- validate(" leading-space:and:weirdchars")
+validate(" leading-space:and:weirdchars")
```
That was never a valid package name, so you get this: