Created
January 13, 2020 05:47
-
-
Save nathakits/de761919ea78f6d5b97367c9041173c9 to your computer and use it in GitHub Desktop.
Used to find matching header in vue files
This file contains 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 fs = require('fs'); | |
const glob = require('glob'); | |
const fileType = 'pages/**/*.vue'; | |
glob(fileType, function (err, files) { | |
files.forEach(file => { | |
const data = fs.readFileSync(file, 'utf8'); | |
const matchH1 = data.match(/h1/g); | |
if (matchH1) { | |
// console.log('Yes'); | |
} else { | |
console.log(file); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment