swchrm logs

妄想技術録

npmコマンドでの型定義ファイルの取得方法

他のやりかた

typingsを使う方法もあります。
下記記事に記載があります。

swchrm.hatenablog.com

実行の様子

three.jsを題材にしています。

MyMacBookAir:VNavi swchrm$ npm install --save @types/three
npm WARN @ionic/pro@2.0.4 requires a peer of cordova-plugin-ionic@^5.0.0 but none is installed. You must install peer dependencies yourself.

+ @types/three@0.93.14
added 1 package from 24 contributors and audited 50839 packages in 13.25s
found 0 vulnerabilities

型定義ファイルはどこにいくのか

node_module/@types配下に収まる。

参考文献

www.npmjs.com