spee.ch/build/getFolderNames.js

11 lines
280 B
JavaScript
Raw Normal View History

2018-03-22 05:53:25 +01:00
const { lstatSync, readdirSync } = require('fs');
const { join } = require('path');
export const getSubDirectoryNames = (root) => {
return readdirSync(root)
.filter(name => {
let fullPath = join(root, name);
return lstatSync(fullPath).isDirectory();
});
};