https://github.com/yarnpkg/yarn - 17,271 stars
https://github.com/npm/npm - 10,807 stars
It's in the works and slated for a later release, but makes it such that yarn is not a universally viable replacement for npm yet.
Actions like "copy this file", "clear this subdirectory", and "pull these files over the network" are easy to write synchronously in node, are there are modules for things that aren't.
For more complex actions, there are modules like env-cmd or cross-env for setting environmental variables on different platforms. If you had something really complex, you could check os.platform() and then call scripts written for each OS.
But you're right, you can't write a .sh shell script and expect it to magically work on Windows.
> there is no yarn equivalent to "npm run ..."
https://yarnpkg.com/en/docs/cli/run ? (I am not primarily a node dev, so I might be missing some nuance here.)