title: How to know the version of currently installed package from yarn.lock
body: <p>I am writing an internal tool which compares the version installed in a project and only allow certain version to be passed. For that I have to check the version which is resolved in the <code>yarn.lock</code> file, as package.json file has a semver range, not specific version and it doesn't tell you the dependency of the dependency anyway.  </p>
  
  <p>I tried using <code>yarn list</code> command, but it prints the semver range too and is very hard to parse (even with <code>--json</code> option).
  So <code>yarn.lock</code> seems like the only way. I know that <code>yarn.lock</code> may have separate versions of the same package and in that case I want only the version which is installed in. the <code>node_nodules</code> (must be just one of them). I have no idea how to parse the lockfile though.  </p>
  
  <p>Another way I could think of is actually going into <code>node_modules</code> folder and checking the version in the <code>package.json</code> of the package.  </p>
  
  <p>None of the above option looks clean to me. Is there any way I can know the resolved version of a specific package (provided I know the name of the package and I know that it's installed) easily and as cleanly as possible?</p>
  
  <p><strong>Update</strong>:<br>
  I actually wanted all the versions of the installed package (even if they're really deep in the dependency tree).</p>