Jump to content

Recommended Posts

Posted

I really need some help here. I'm trying to write a program in ASP/JavaScript that will read and list all the files in the current directory. Like for example in BASIC I would type the command, DIR. 

This is what I found. but I am confused ---

var fs = require('fs'); 

var files = fs.readdirSync('/assets/photos/'); 

 

require??? Never heard of it before. it appears they're trying to make an object. But wouldn't that be an object of type directory? Can you help me out please? 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...