That's not the same thing. Npx is for running commands you install from npm, and yarn [command] allows you to run scripts defined in your package.json file.
Re:JavaScript is Eating the World
by fahrradflucht on Thursday August 24, 2017 @02:02PM
(#15092476)
npm always did this. The OC said that he likes that yarn can also run local binaries that are not a npm script.
[0] https://www.npmjs.com/package/npx