Running a folder in index.js

I’m trying to run a folder in the index.js and it cant find it even though its there how do I get it to run the folder?

I think you want just "./Info"? .. = parent folder.

2 Likes

just tried it and it didnt work

By “running” the folder, do you mean running each file inside the folder?

2 Likes

Are you tryingo to run the folder itself? Not the file inside the folder, like info.js?

Like this:

const info = require('./Info/Info.js');

1 Like

sorry i havent been on i have not been near my device but yes im trying to run the folder itself but there is no info.js file its just jsons in the folder but let me see if I could try to add it

this worked thank you so much

alternatively you could rename Info.js to index.jsand do just require("./Info")

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.