npm exec --package=typescript -- tsc --version

Category: Node.js & npm/yarn

npm exec --package=typescript -- tsc --version

Run a tool from a temporary package

Downloads typescript into a temporary location and runs its tsc binary, without adding it to package.json. The --package flag names the package to fetch and the double dash separates npm exec flags from the command. npx is the shorthand for the same behavior.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.