Open5

TypeScriptメモ

kentamakentama
npm install @types/node -D

https://github.com/jeffijoe/typesync

vim install-with-types.sh
install-with-types.sh
#!/usr/bin/env bash

npm install $1
npx typesync
npm install
chmod +x install-with-types.sh
package.json
{
  "scripts": {
    "i": "./install-with-types.sh"
  }
}
kentamakentama
npx tsc --init
Created a new tsconfig.json with:
                                                                                                                     TS
  target: es2016
  module: commonjs
  strict: true
  esModuleInterop: true
  skipLibCheck: true
  forceConsistentCasingInFileNames: true


You can learn more at https://aka.ms/tsconfig
kentamakentama
vim example.ts
example.ts
console.log("hello world");

実行

npx ts-node example.ts
hello world