Last active
November 1, 2017 15:37
-
-
Save Avaray/b38c5421b6e7dc013458ed8903cf0d69 to your computer and use it in GitHub Desktop.
Node JS // Get list of all directories (not recursive)
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
var fs = require('fs') | |
var path = require('path') | |
var location = 'content' | |
fs.readdirSync(location) | |
.filter(x => { | |
return fs.lstatSync(path.join(location, x)).isDirectory() | |
}) | |
.forEach(dir => { | |
console.log(dir) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment