When I ran my commands in Node command prompt, they worked fine.
fs= require('fs')
fs.readdir('.',function(e,files){console.log(files)})
However, when I inserted the lines above into my gruntfile.js, the callback function was not executed at all. Can you please tell me how I can get a list of files in a certain folder in Gruntfile.js?
Gruntfile.js:
'use strict';
var fs= require('fs');
module.exports= function(grunt){
var configs = require('load-grunt-configs')(grunt);
grunt.initConfig(configs);
require('load-grunt-tasks')(grunt);
fs.readdir('.', function(err,files){
console.log(files);
})
}