@jdalton Instead of opening a browser window/tab, I think yarn search
should list the search results in the CLI perhaps using the npms
API. We might also need a way to search for Bower dependencies.
I think yarn search should list the search results in the CLI perhaps using the npms API.
I wonder whether that's worth the maintenance cost, given the site already exists. In general, for something like this where you want to search and browse through a listing or collection of things, a rich graphical interface like a website is always going to provide a better user experience than a CLI app.
In general, for something like this where you want to search and browse through a listing or collection of things, a rich graphical interface like a website is always going to provide a better user experience than a CLI app.
I think that's somewhat subjective and probably depends on the amount of data presented. Plus, there's already a precedence for CLI-only results (i.e., bower search
and npm search
).
We've deliberately decided not to add these sorts of commands to Yarn. There's a lot of them that don't actually see much use and the maintenance burden isn't really worth it. If the functionality of the commands is so simple (just opening a browser) then you can just do it yourself. Thanks for the report!
Ya, mainly wanted to show some :heart: for npms.io and figured yarn integration via opening a browser to a given search would help (yarn improving pkg installs & npms.io improving search).
Related to https://twitter.com/mrmrs_/status/763481520791232512.
@jdalton Thank you, it's an honour to have such an important member of the community suggesting npms.io. I tend to agree with @kittens, but if this project gets enough traction to actually "replace" npm (like lodash effectively replaced underscore for most devs), I think it's reasonable to have a search functionality. Many many developers still prefer to do these kind of tasks from the console. If you look at https://github.com/npms-io, the npms-cli
repo has more stars than npms-www
.
FYI, we've documented our new search API (that builds on the npms.io folks work) over here, if you ever decide you want to fold that in.
Lol is this for real? Such a big maintenance burden to dump search results from an API.
Personally I think this would be a great function. Why would I have to go all the way to the browser, open a specific page, search, copy paste a name of a package into the terminal I just came from, when all I wanted was to check what the exact name of the package for "bootswatch" was so I could run yarn add on it?
I vote for this function 馃憤
For what it's worth, npms.io has a CLI which you can install using yarn global add npms-cli
and then use like npms search foobar
.
That being said, I do think that Yarn deserves its own built-in search. I can't imagine that it would lead to much maintenance work, it's a very simple function in comparison to the rest of Yarn.
@denizdogan npms
package has nothing to do with npms website. Please modify your post with the correct package name npms-cli
.
@vinilios Oops, fixed
Hey 馃憢 I ran over this issue and created Emma CLI. I would love to get some feedback! 馃檪
If you're specifically interested in packages with TypeScript type declarations, there's [dtsearch]:
$ npx dtsearch sprintf
DLS NAME TYPES DESCRIPTION
533.3k sprintf @types/sprintf sprintf() for node.js
47.4m sprintf-js @types/sprintf-js JavaScript sprintf implementation
82.9m extsprintf @types/extsprintf extended POSIX-style sprintf
2.1m ssf <bundled> Format data using ECMA-376 spreadsheet Format Codes
1.6m printj <bundled> Pure-JS printf
123k voca @types/voca The ultimate JavaScript string library
746.4k printf <bundled> Full implementation of the `printf` family in pure JS.
1.5k sprintfjs <bundled> POSIX sprintf(3)-style String Formatting for JavaScript
169 @jitesoft/sprintf <bundled> sprintf function for javascript.
94 stringd <bundled> A string variable parser for JavaScript
It uses the same Algolia search as yarnpkg.com. It's geared towards TS users but can search all npm packages with a flag (-u
).
Most helpful comment
Personally I think this would be a great function. Why would I have to go all the way to the browser, open a specific page, search, copy paste a name of a package into the terminal I just came from, when all I wanted was to check what the exact name of the package for "bootswatch" was so I could run yarn add on it?
I vote for this function 馃憤