Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
This could also be a feature request or a docs update depending how you look at it...
When calling npm search with the --long flag, e.g.
> npm search --long --json --searchlimit 1 color
I get this output, which is identical to calling search without --long
[
{
"name": "color",
"scope": "unscoped",
"version": "4.2.3",
"description": "Color conversion and manipulation with CSS string support",
"keywords": [
"color",
"colour",
"css"
],
"date": "2022-04-05T09:15:16.379Z",
"links": {
"npm": "https://www.npmjs.com/package/color",
"homepage": "https://github.com/Qix-/color#readme",
"repository": "https://github.com/Qix-/color",
"bugs": "https://github.com/Qix-/color/issues"
},
"publisher": {
"username": "qix",
"email": "josh@junon.me"
},
"maintainers": [
{
"username": "qix",
"email": "josh@junon.me"
}
]
}
]
Expected Behavior
I expected more information, perhaps the full output of registry search
For example
> npm search --long --json --searchlimit 1 color
[
{
"package": {
"name": "color",
"scope": "unscoped",
"version": "4.2.3",
"description": "Color conversion and manipulation with CSS string support",
"keywords": [
"color",
"colour",
"css"
],
"date": "2022-04-05T09:15:16.379Z",
"links": {
"npm": "https://www.npmjs.com/package/color",
"homepage": "https://github.com/Qix-/color#readme",
"repository": "https://github.com/Qix-/color",
"bugs": "https://github.com/Qix-/color/issues"
},
"publisher": {
"username": "qix",
"email": "josh@junon.me"
},
"maintainers": [
{
"username": "qix",
"email": "josh@junon.me"
}
]
},
"flags": {
"insecure": 0
},
"score": {
"final": 0.38903615890331245,
"detail": {
"quality": 0.5395409662759634,
"popularity": 0.4959066747321972,
"maintenance": 0.15316152246929846
}
},
"searchScore": 100000.43
}
]
Steps To Reproduce
Run the commands above. I've checked on 8.x, 9.x and 10.6.0 using nvm
It looks like the config value is never used in search.js. Compare the other referenced commands from the help docs: ls.js and help-search.js. Both access the config via this.npm.config.get('long'), but search.js only uses this.npm.flatOptions which doesn't contain the long prop.
Environment
- npm: 10.6.0
- Node.js: 20.12.2
- OS Name: ArchLinux
- System Model Name: Toaster
- npm config:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
This could also be a feature request or a docs update depending how you look at it...
When calling
npm searchwith the--longflag, e.g.> npm search --long --json --searchlimit 1 colorI get this output, which is identical to calling search without
--long[ { "name": "color", "scope": "unscoped", "version": "4.2.3", "description": "Color conversion and manipulation with CSS string support", "keywords": [ "color", "colour", "css" ], "date": "2022-04-05T09:15:16.379Z", "links": { "npm": "https://www.npmjs.com/package/color", "homepage": "https://github.com/Qix-/color#readme", "repository": "https://github.com/Qix-/color", "bugs": "https://github.com/Qix-/color/issues" }, "publisher": { "username": "qix", "email": "josh@junon.me" }, "maintainers": [ { "username": "qix", "email": "josh@junon.me" } ] } ]Expected Behavior
I expected more information, perhaps the full output of registry search
For example
> npm search --long --json --searchlimit 1 color[ { "package": { "name": "color", "scope": "unscoped", "version": "4.2.3", "description": "Color conversion and manipulation with CSS string support", "keywords": [ "color", "colour", "css" ], "date": "2022-04-05T09:15:16.379Z", "links": { "npm": "https://www.npmjs.com/package/color", "homepage": "https://github.com/Qix-/color#readme", "repository": "https://github.com/Qix-/color", "bugs": "https://github.com/Qix-/color/issues" }, "publisher": { "username": "qix", "email": "josh@junon.me" }, "maintainers": [ { "username": "qix", "email": "josh@junon.me" } ] }, "flags": { "insecure": 0 }, "score": { "final": 0.38903615890331245, "detail": { "quality": 0.5395409662759634, "popularity": 0.4959066747321972, "maintenance": 0.15316152246929846 } }, "searchScore": 100000.43 } ]Steps To Reproduce
Run the commands above. I've checked on 8.x, 9.x and 10.6.0 using
nvmIt looks like the config value is never used in
search.js. Compare the other referenced commands from the help docs:ls.jsandhelp-search.js. Both access the config viathis.npm.config.get('long'), butsearch.jsonly usesthis.npm.flatOptionswhich doesn't contain thelongprop.Environment
; nothing special