Wondering how big is your React project?

Recently I wanted to explore the impact of a refactoring I did so I ended up checking the length of the files I’ve had in git (hoping that this number would decrease).

The magic command was to list the files in git, grep the ones ending with js, jsx and css and count the lines.

git ls-files | grep -P ".*(js|jsx|css)$" | xargs wc -l

This works both on Linux and Windows with Git Bash

Side note: Feel free to remove/add/change extentions in the (js|jsx|css) to check your source files.

Thanks to this Stack Overflow question 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.