This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')(); | |
const fs = require('fs'); | |
// Resolves with a list of the filenames in dir, or rejects if dir doesn't exist or if something else goes wrong. | |
function readFileNames(dir) { | |
return new Promise((resolve, reject) => { | |
fs.readdir(dir, (err, files) => { | |
if (err) { | |
reject(err); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')(); | |
const fs = require('fs'); | |
// Resolves with a list of the filenames in dir, or rejects if dir doesn't exist or if something else goes wrong. | |
function readFileNames(dir) { | |
return new Promise((resolve, reject) => { | |
fs.readdir(dir, (err, files) => { | |
if (err) { | |
reject(err); | |
} else { |