npm-profile
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -7,2 +7,3 @@ 'use strict' | ||
const { URL } = require('url') | ||
const log = require('proc-log') | ||
@@ -14,3 +15,3 @@ // try loginWeb, catch the "not supported" message and fall back to couch | ||
if (er instanceof WebLoginNotSupported) { | ||
process.emit('log', 'verbose', 'web login not supported, trying couch') | ||
log.verbose('web login not supported, trying couch') | ||
return prompter(creds) | ||
@@ -28,3 +29,3 @@ .then(data => loginCouch(data.username, data.password, opts)) | ||
if (er instanceof WebLoginNotSupported) { | ||
process.emit('log', 'verbose', 'web adduser not supported, trying couch') | ||
log.verbose('web adduser not supported, trying couch') | ||
return prompter(creds) | ||
@@ -39,3 +40,3 @@ .then(data => adduserCouch(data.username, data.email, data.password, opts)) | ||
const adduserWeb = (opener, opts = {}) => { | ||
process.emit('log', 'verbose', 'web adduser', 'before first POST') | ||
log.verbose('web adduser', 'before first POST') | ||
return webAuth(opener, opts, { create: true }) | ||
@@ -45,3 +46,3 @@ } | ||
const loginWeb = (opener, opts = {}) => { | ||
process.emit('log', 'verbose', 'web login', 'before first POST') | ||
log.verbose('web login', 'before first POST') | ||
return webAuth(opener, opts, {}) | ||
@@ -70,3 +71,3 @@ } | ||
const { doneUrl, loginUrl } = content | ||
process.emit('log', 'verbose', 'web auth', 'got response', content) | ||
log.verbose('web auth', 'got response', content) | ||
if (!isValidUrl(doneUrl) || !isValidUrl(loginUrl)) { | ||
@@ -77,3 +78,3 @@ throw new WebLoginInvalidResponse('POST', res, content) | ||
}).then(({ doneUrl, loginUrl }) => { | ||
process.emit('log', 'verbose', 'web auth', 'opening url pair') | ||
log.verbose('web auth', 'opening url pair') | ||
return opener(loginUrl).then( | ||
@@ -131,3 +132,3 @@ () => webAuthCheckLogin(doneUrl, { ...opts, cache: false }) | ||
} | ||
process.emit('log', 'verbose', 'adduser', 'before first PUT', logObj) | ||
log.verbose('adduser', 'before first PUT', logObj) | ||
@@ -158,5 +159,5 @@ const target = '/-/user/org.couchdb.user:' + encodeURIComponent(username) | ||
} | ||
process.emit('log', 'verbose', 'login', 'before first PUT', logObj) | ||
log.verbose('login', 'before first PUT', logObj) | ||
const target = '-/user/org.couchdb.user:' + encodeURIComponent(username) | ||
const target = '/-/user/org.couchdb.user:' + encodeURIComponent(username) | ||
return fetch.json(target, { | ||
@@ -163,0 +164,0 @@ ...opts, |
{ | ||
"name": "npm-profile", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Library for updating an npmjs.com profile", | ||
@@ -9,3 +9,4 @@ "keywords": [], | ||
"dependencies": { | ||
"npm-registry-fetch": "^12.0.0" | ||
"npm-registry-fetch": "^12.0.2", | ||
"proc-log": "^2.0.0" | ||
}, | ||
@@ -22,5 +23,5 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@npmcli/template-oss": "^2.5.1", | ||
"nock": "^13.2.1", | ||
"tap": "^15.1.5" | ||
"@npmcli/template-oss": "^2.7.1", | ||
"nock": "^13.2.4", | ||
"tap": "^15.1.6" | ||
}, | ||
@@ -36,3 +37,4 @@ "scripts": { | ||
"postlint": "npm-template-check", | ||
"lintfix": "npm run lint -- --fix" | ||
"lintfix": "npm run lint -- --fix", | ||
"template-copy": "npm-template-copy --force" | ||
}, | ||
@@ -46,4 +48,4 @@ "tap": { | ||
"templateOSS": { | ||
"version": "2.5.1" | ||
"version": "2.7.1" | ||
} | ||
} |
@@ -529,10 +529,11 @@ # npm-profile | ||
This modules logs by emitting `log` events on the global `process` object. | ||
This modules logs by emitting `log` events on the global `process` object | ||
via [`proc-log`](https://www.npmjs.com/package/proc-log). | ||
These events look like this: | ||
```js | ||
process.emit('log', 'loglevel', 'feature', 'message part 1', 'part 2', 'part 3', 'etc') | ||
procLog[loglevel]('feature', 'message part 1', 'part 2', 'part 3', 'etc') | ||
``` | ||
`loglevel` can be one of: `error`, `warn`, `notice`, `http`, `timing`, `info`, `verbose`, and `silly`. | ||
`loglevel` can be one of: `error`, `warn`, `notice`, `http`, `info`, `verbose`, and `silly`. | ||
@@ -546,3 +547,3 @@ `feature` is any brief string that describes the component doing the logging. | ||
```js | ||
process.emit('log', 'http', 'request', '→', conf.method || 'GET', conf.target) | ||
procLog.http('request', '→', conf.method || 'GET', conf.target) | ||
``` | ||
@@ -553,6 +554,5 @@ | ||
```js | ||
const log = require('npmlog') | ||
process.on('log', function (level) { | ||
return log[level].apply(log, [].slice.call(arguments, 1)) | ||
process.on('log', (level, feature, ...args) => { | ||
console.log(level, feature, ...args) | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
255
12
27470
2
+ Addedproc-log@^2.0.0
+ Addedproc-log@2.0.1(transitive)
Updatednpm-registry-fetch@^12.0.2