Created
December 15, 2022 12:37
-
-
Save qwertypants/50bae6c0c2e3c4eddaf2eeb97568c8dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob'); | |
const jsFiles = glob.sync('src/**/*.js'); | |
const tsFiles = glob.sync('src/**/*.ts'); | |
const tsxFiles = glob.sync('src/**/*.tsx'); | |
const allTsFiles = tsFiles.concat(tsxFiles); | |
console.log(`There are ${jsFiles.length} .js files in the 'src' directory.`); | |
console.log(`There are ${allTsFiles.length} .ts/x files in the 'src' directory.`); | |
console.log(`${Math.round((allTsFiles.length / jsFiles.length) * 100)}% of the files are TypeScript files.`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment