Skip to content

Instantly share code, notes, and snippets.

@azu
azu / TypeScriptの設定の良し悪し.md
Last active April 1, 2024 10:23
TypeScriptの設定の良し悪し

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@naoty
naoty / hatena2md.rb
Last active May 2, 2021 12:28
はてなブログからエクスポートしたMT形式のファイルをMarkdownファイルに分割するやつ
require "bundler/inline"
require "pathname"
require "time"
require "uri"
abort "[USAGE]: hatena2md <exported file> <output dir>" if ARGV.length < 2
exported_file_path = ARGV[0]
output_dir = Pathname.new(ARGV[1])
output_dir.mkpath unless output_dir.exist?