By default, grep displays the lines in one or more files that match your search string (or regular expression). Here is how you recursively search through a directory of files and list the name(s) of the files that contain a matching string instead of the matched line.
grep -l Switch
This command causes grep to search for lines that match the query SEARCH TERM in every .js file in the working directory. The application will print the names of the files that contain a match to the standard output stream.
SEARCH TERM with your query and *.js with any filetype or the names of a set of files that you would like to search. The query can be a string or regular expression.