How to read the content of a directory

Hi Friends, In the previous article, I have written the process about how to convert the PDF pages to PNG In this article, I will tell you how to read the converted images and return those images as a REST API endpoint. So Lets Start.

If you didn’t read my previous article please go through it since this is the extension of that article

How to convert PDF file pages to PNG images-node.js

We will create the two endpoints

app.js file

That’s it. You will get the response with the complete list of items as a JSON object through calling the REST API. Thanks for reading the article.

Originally published at



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store