Retrieving files from Directory Node Js

前端 未结 2 651
刺人心
刺人心 2021-02-06 21:08

I am using readDirSync to get the files from a Diretory. PLease find the code and error as following.

var fs = require(\'fs\');
var files = fs.readdirSync(\'./ap         


        
2条回答
  •  忘掉有多难
    2021-02-06 21:32

    Have you tried the following?

    var files = fs.readdirSync(__dirname+'/application/models/');
    

提交回复
热议问题