BOMBYASCHER/TXT-combiner

View on GitHub
src/options/allfiles.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { readdirSync, statSync } from 'node:fs';
import buildpath from '../buildpath.js';

export default (directoryPath = '.') => {
  const content = readdirSync(buildpath(directoryPath));
  return content.filter((elem) => statSync(buildpath(directoryPath, elem)).isFile());
};