spee.ch/build/getFolderNames.js
2018-03-21 22:06:35 -07:00

10 lines
282 B
JavaScript

const { lstatSync, readdirSync } = require('fs');
const { join } = require('path');
export const getSubDirectoryNames = (root) => {
return readdirSync(root)
.filter(name => {
const fullPath = join(root, name);
return lstatSync(fullPath).isDirectory();
});
};