How do I search for packages with yarn? I want to get a list of results that have the search term in the name of the package as well as in descriptions (similar to how various utilities work like npm search
, apropos
, apt-cache search
).
I tried yarn info <pkg>
, but this gave a bunch of json data that was limited to just that package.
Using yarn help
and duckduckgo was educational, but still didn't answer how to do this.
Most packages will be installed from the npm registry and referred to by simply their package name. For example, yarn add react will install the react package from the npm registry.
yarn link [package...]Use yarn link [package] to link another package that you'd like to test into your current project. To follow the above example, in the react-relay project, you'd run yarn link react to use your local version of react that you previously linked.
Every yarn package must have a package. json file which yarn looks for in order to identify the package. This file configures the behavior of yarn while it is running inside that package.
there is no command for showing the tabular data format of package information
if you what more information about the packages you can try below commands you will get more information
yarn info package yarn info package --json yarn info package@version yarn info package description yarn info package time yarn info package readme
I came here via google and none of the answers really explained anything about WHY search was "missing", so I dug in a bit.
From the Yarn dev's github issue tracker, this exact topic was brought up:
kittens commented on Oct 12, 2016
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!
So there you go, it has been intentionally not included and there are currently no plans to include it.
As others have said, you can either use npm
's search as both yarn and npm fetch from the same list of packages, or you can use a web-based solution:
Hope this helps others save a few minutes in their quest for an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With