Script to track % of TypeScript in your repo / project
If you are migrating to TypeScript it may be nice to keep track of how you are doing for a particular project, here is an example of using Tokei
and jq
to do this.
You can install both via Homebrew
brew install jq
brew install tokei
Run this in the root of your project.
Use -e
to exlude any tests, fixtures you don't want to count
tokei
-e test/fixtures
-o json | jq '100 * .inner.TypeScript.code / (.inner.JavaScript.code + .inner.TypeScript.code)'