So I'm writing a website that shows images, and I need to get all the filenames of the images.
I tried:
var fs = require("fs");
var files = fs.readdirSync("./images");
But it says 'Uncaught ReferenceError: require is not defined'
So I'm writing a website that shows images, and I need to get all the filenames of the images.
I tried:
var fs = require("fs");
var files = fs.readdirSync("./images");
But it says 'Uncaught ReferenceError: require is not defined'