How can the fs module of Node be called in the html file

currently there are only two files. Packaging node into exe executable files requires node-webkit;

there are basically two files on the Internet, but the problem is how to call the fs module require in html doesn"t seem to work!

clipboard.png

want to call node"s fs module in app.html.

Mar.18,2021

Sorry, fs can only be called in the context of node. Html is a static file, which needs to be parsed by the browser, so there is no way for the time being.


  1. HTML cannot call Node's fs module because there is no node environment in the browser, and you are not allowed to use the node environment
  2. if you want to do desktop applications, it's possible to use node-webkit, but I haven't done it. I have used Electron, to send a request to the main process using the rendering process, and then return it to the rendering process after the operation of the main process. It is recommended to read the document carefully, or combine the corresponding keywords to search, but your question itself is wrong.

to package exe, with node, you can consider electron


one is a static file, the other is a server program, and the latter can operate the former at will, and vice versa.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3544a-2acc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3544a-2acc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?