This Node.js application allows you to search for a specific keyword within PDF files in a given directory.
Node.js installed on your system
- The program utilizes the pdf-parse library to extract text from PDF files.
- It prompts the user for a keyword and the path to the directory containing PDF files.
- The application then searches for the specified keyword within the text of all PDF files in the given directory.
- If the keyword is found in a PDF file, the filename is added to the list of matching files.
- Finally, the program displays the list of PDF files that contain the specified keyword.
Note: PDF files in the specified directory must have the ".pdf" extension to be considered.
- Clone this repository to your local machine.
- Open a terminal window and navigate to the project directory.
- Run npm install to install the required dependencies.
- Run the program using the following command:
node pdf-search.js
- Enter the keyword you want to search for when prompted.
- Enter the path to the directory containing the PDF files when prompted.
- pdf-parse: pdf-parse on npm
- prompt-sync: prompt-sync on npm
Enter the keyword to search for: Software
Enter the path to the pdf folder: /path/to/pdf/files