summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-profile/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npm-profile/README.md')
-rw-r--r--deps/npm/node_modules/npm-profile/README.md61
1 files changed, 46 insertions, 15 deletions
diff --git a/deps/npm/node_modules/npm-profile/README.md b/deps/npm/node_modules/npm-profile/README.md
index e1c13ef387..001c551cf4 100644
--- a/deps/npm/node_modules/npm-profile/README.md
+++ b/deps/npm/node_modules/npm-profile/README.md
@@ -50,12 +50,13 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
-Otherwise the code will be the HTTP response code.
+Otherwise the code will be `'E'` followed by the HTTP response code, for
+example a Forbidden response would be `E403`.
### profile.login(username, password, config) → Promise
@@ -93,11 +94,11 @@ An object with a `token` property that can be passed into future authentication
An error object indicating what went wrong.
-If the object has a `code` property set to `otp` then that indicates that
+If the object has a `code` property set to `EOTP` then that indicates that
this account must use two-factor authentication to login. Try again with a
one-time password.
-If the object has a `code` property set to `ip` then that indicates that
+If the object has a `code` property set to `EAUTHIP` then that indicates that
this account is only allowed to login from certain networks and this ip is
not on one of those networks.
@@ -157,10 +158,10 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
Otherwise the code will be the HTTP response code.
@@ -256,10 +257,10 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
Otherwise the code will be the HTTP response code.
@@ -300,10 +301,10 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
Otherwise the code will be the HTTP response code.
@@ -338,10 +339,10 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
Otherwise the code will be the HTTP response code.
@@ -389,9 +390,39 @@ An error object indicating what went wrong.
The `headers` property will contain the HTTP headers of the response.
If the action was denied because an OTP is required then `code` will be set
-to `otp`.
+to `EOTP`.
If the action was denied because it came from an IP address that this action
-on this account isn't allowed from then the `code` will be set to `ipaddress`.
+on this account isn't allowed from then the `code` will be set to `EAUTHIP`.
Otherwise the code will be the HTTP response code.
+
+## Logging
+
+This modules logs by emitting `log` events on the global `process` object.
+These events look like this:
+
+```
+process.emit('log', 'loglevel', 'feature', 'message part 1', 'part 2', 'part 3', 'etc')
+```
+
+`loglevel` can be one of: `error`, `warn`, `notice`, `http`, `timing`, `info`, `verbose`, and `silly`.
+
+`feature` is any brief string that describes the component doing the logging.
+
+The remaining arguments are evaluated like `console.log` and joined together with spaces.
+
+A real world example of this is:
+
+```
+ process.emit('log', 'http', 'request', '→',conf.method || 'GET', conf.target)
+```
+
+To handle the log events, you would do something like this:
+
+```
+const log = require('npmlog')
+process.on('log', function (level) {
+ return log[level].apply(log, [].slice.call(arguments, 1))
+})
+```