I am fairly new to JavaScript, I am writing a machine learning code in which i have to include the data-set, I need the code to read all the text files stored in a directory but i am just not able to do it.
I tried to use some other modules but nothing exactly mentioned on how to get all the text files at once, they all tell how to include a single text file, the code given below is what i tried but it gives me a error "require not defined"
<script type="text/javascript">
var fs = require('fs')
const file = fs.readdirsync('C:\Users\akash\Desktop\New folder\ham\ham')
console.log(file)
</script>