diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-12-07 14:05:23 -0800 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-01-19 11:32:08 -0500 |
commit | d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5 (patch) | |
tree | 321928c015be00cdbe11715297d2d2fc45802263 /deps/npm/node_modules/npm-profile/README.md | |
parent | bfe41fe88e7421f441067a79fb7512cf5935a2bb (diff) | |
download | android-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.tar.gz android-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.tar.bz2 android-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.zip |
deps: upgrade npm to 5.6.0
PR-URL: https://github.com/nodejs/node/pull/17777
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/npm-profile/README.md')
-rw-r--r-- | deps/npm/node_modules/npm-profile/README.md | 61 |
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)) +}) +``` |