globalにインストールしたくない場合のコマンドの動かし方。
下のようにインストールした場合
npm init
npm install typescript --save
```
これでも動く
./node_modules/typescript/bin/tsc -v(バージョン確認)
けれど、
npm run コマンド
下のようにpackage.jsonに書いて、runコマンドを使うと、npm run tsc
で実行できてしまう。
package.json
{
"name": "test",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"tsc": "tsc"
},
"author": "naoki",
"license": "MIT",
"devDependencies": {
}
}