Skip to content

Instantly share code, notes, and snippets.

@yuvalbl
Created October 16, 2017 15:51
Show Gist options
  • Save yuvalbl/af9e056b603902021a7d80f31c772efe to your computer and use it in GitHub Desktop.
Save yuvalbl/af9e056b603902021a7d80f31c772efe to your computer and use it in GitHub Desktop.
find in files
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