aboutsummaryrefslogtreecommitdiff
path: root/node_modules/normalize-package-data/README.md
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-20 03:09:25 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-24 16:14:29 +0200
commit82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8 (patch)
tree965f6eb89b84d65a62b49008fd972c004832ccd1 /node_modules/normalize-package-data/README.md
parente6e0cbc387c2a77b48e4065c229daa65bf1aa0fa (diff)
Reorganize module loading.
We now use webpack instead of SystemJS, effectively bundling modules into one file (plus commons chunks) for every entry point. This results in a much smaller extension size (almost half). Furthermore we use yarn/npm even for extension run-time dependencies. This relieves us from manually vendoring and building dependencies. It's also easier to understand for new developers familiar with node.
Diffstat (limited to 'node_modules/normalize-package-data/README.md')
-rw-r--r--node_modules/normalize-package-data/README.md13
1 files changed, 6 insertions, 7 deletions
diff --git a/node_modules/normalize-package-data/README.md b/node_modules/normalize-package-data/README.md
index 526745ef6..377277797 100644
--- a/node_modules/normalize-package-data/README.md
+++ b/node_modules/normalize-package-data/README.md
@@ -1,6 +1,6 @@
# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)
-normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
+normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.
@@ -16,7 +16,7 @@ Basic usage is really simple. You call the function that normalize-package-data
```javascript
normalizeData = require('normalize-package-data')
-packageData = fs.readFileSync("package.json")
+packageData = require("./package.json")
normalizeData(packageData)
// packageData is now normalized
```
@@ -27,8 +27,7 @@ You may activate strict validation by passing true as the second argument.
```javascript
normalizeData = require('normalize-package-data')
-packageData = fs.readFileSync("package.json")
-warnFn = function(msg) { console.error(msg) }
+packageData = require("./package.json")
normalizeData(packageData, true)
// packageData is now normalized
```
@@ -41,7 +40,7 @@ Optionally, you may pass a "warning" function. It gets called whenever the `norm
```javascript
normalizeData = require('normalize-package-data')
-packageData = fs.readFileSync("package.json")
+packageData = require("./package.json")
warnFn = function(msg) { console.error(msg) }
normalizeData(packageData, warnFn)
// packageData is now normalized. Any number of warnings may have been logged.
@@ -78,7 +77,7 @@ If the supplied data has an invalid name or version vield, `normalizeData` will
* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.
* If `homepage` field is not a string, it will be removed.
* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.
-* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
+* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
### Rules for name field
@@ -86,7 +85,7 @@ If `name` field is given, the value of the name field must be a string. The stri
* start with a period.
* contain the following characters: `/@\s+%`
-* contain and characters that would need to be encoded for use in urls.
+* contain any characters that would need to be encoded for use in urls.
* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).
### Rules for version field