Load text files in JavaScript

Asked 2 years ago, Updated 2 years ago, 20 views

No matter what site I look at, I only load files using input

Is it possible to load text files on the same server when loading?

Assume Javascript running on the server side

javascript

2022-09-29 21:40

1 Answers

As it is on the server side, I think it is standard to use the FS module of Node.js.

File System | Node.js v11.9.0 Documentation

There is also an example of loading one line at a time.

Example:Read File Stream Line-by-Line


2022-09-29 21:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.