const fs = require("fs");

let res = "";
let json = `const gallery = {
    pic: [`;

let jsonEnd = `
],
};`;
fs.readdir("./", (err, files) => {
  files.forEach((file, index) => {
    if (file === "readimg.js") {
      return;
    }
    console.log(file);
    res += `import pic${index} from "../pics/gallery/${file}";\n`;
    json += `{
    title: "",
    content: "",
    img: pic${index}
  },`;
  });

  console.log(res);
  console.log(json + jsonEnd);
});
