MCPcopy
hub / github.com/expressjs/generator / emptyDirectory

Function emptyDirectory

bin/express-cli.js:381–386  ·  view source on GitHub ↗

* Check if the given directory `dir` is empty. * * @param {String} dir * @param {Function} fn

(dir, fn)

Source from the content-addressed store, hash-verified

379 */
380
381function emptyDirectory (dir, fn) {
382 fs.readdir(dir, function (err, files) {
383 if (err && err.code !== 'ENOENT') throw err
384 fn(!files || !files.length)
385 })
386}
387
388/**
389 * Graceful exit for async STDIO

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected