List amount of files in a folder

Asked

Viewed 481 times

0

I am working on a small system and I am using web for N reasons, easy to customize, work with full screen (F11), everything is flowing fine. I arrived in a part that I need to list the number of files that are inside a certain directory and I saw that it is impossible to do with Javascript but that I can use Node.js.. However, I find it so bad to have to install Node.js only to run 4 lines of code, will break my idea until you leave the system super light.

Is there any way around this? Some way to get the amount of files that are inside a directory?

Thank you.

(Just confirming, if I develop using Node.js the client will also need to have it installed, correct?)

  • If the distribution for your client is offline, yes, otherwise it is possible to host on a server easily, and your client will not need the Node. Regarding the performance, I think it would not go down too much with Node, I think it’s a good idea because it was initially designed for handling files on the server, and it does this very quickly and yes, this type of counting is only possible with a server language.

  • 1

    You can migrate your web application to the framework Electron as an app that has greater access to the machine and work without having to install Node.js on the client’s machine to use the app, here’s an example: Electron-file-explorer

  • I forgot to mention, yes the application needs to work offline. It is, but imagine, have to install 15mb just to run 4 lines, because the only thing that is missing is even automate this take the amount of files to know the number of pages that it will run. : / .

  • I don’t know this Lectron, I don’t quite understand how it works but I’ll read about it.

  • Electron is basically a browser with built-in Node. It is made to create desktop applications using web technology (html, css, js + Node). Sounds exactly like your case.

  • Look, cool face.. I’ll see it now! Thanks so much for the help, I believe it will solve my problem.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.