Get all file in the folder.
$ yarn add get-all-file
# or
$ npm install get-all-file
import getAllFile from 'get-all-file';
const files = getAllFile('path');
// => [{name: 'a', suffix: 'js'}]
Type: string
Target folder path when get file.
Type: object
Type: boolean
Default: false
Deep to get file when directory child.
import getAllFile from 'get-all-file';
const files = getAllFile('path', { isDeep: true });
// [
// { name: 'a', suffix: 'js' },
// {
// name: 'css',
// isDir: true,
// children: [
// {
// name: 'a',
// suffix: 'css',
// },
// ],
// },
// ];
Type: boolean
Default: false
Return child name with parent path.
import getAllFile from 'get-all-file';
const files = getAllFile('path', { isDeep: true, prefix: true });
// [
// { name: 'a', suffix: 'js' },
// {
// name: 'css',
// isDir: true,
// children: [
// {
// name: 'css/a',
// suffix: 'css',
// },
// ],
// },
// ];