Created
October 16, 2017 15:51
-
-
Save yuvalbl/af9e056b603902021a7d80f31c772efe to your computer and use it in GitHub Desktop.
find in 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 findInFiles = require('find-in-files'); | |
const fs = require('fs'); | |
findInFiles.find('import', 'src', '.ts$') | |
.then(results => { | |
const files = Object.keys(results); | |
files.forEach((file) => { | |
let result = fs.readFileSync(file, 'utf8'); | |
console.log(result); | |
process.exit(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment